aboutsummaryrefslogtreecommitdiff
path: root/Linux-PAM/modules/install_conf
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 12:44:11 -0800
committerSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 12:44:11 -0800
commitefd31890b5ed496a5a00c08a262da240e66a4ddc (patch)
tree22a7aab22b3a491bb58df250d7d6409e0c160bcc /Linux-PAM/modules/install_conf
parent067affee9267fa0d1c21835182ba639ba33e820f (diff)
downloadpam-efd31890b5ed496a5a00c08a262da240e66a4ddc.tar.gz
pam-efd31890b5ed496a5a00c08a262da240e66a4ddc.tar.bz2
pam-efd31890b5ed496a5a00c08a262da240e66a4ddc.zip
New upstream version 0.76
Diffstat (limited to 'Linux-PAM/modules/install_conf')
-rwxr-xr-xLinux-PAM/modules/install_conf49
1 files changed, 49 insertions, 0 deletions
diff --git a/Linux-PAM/modules/install_conf b/Linux-PAM/modules/install_conf
new file mode 100755
index 00000000..80f6be29
--- /dev/null
+++ b/Linux-PAM/modules/install_conf
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+FAKEROOT=$1
+CONFD=$1$2
+CONFILE=$1$3
+MODULE=$4
+CONF=$5
+
+IGNORE_AGE=./.ignore_age
+QUIET_INSTALL=../../.quiet_install
+
+echo
+
+if [ -f "$QUIET_INSTALL" ]; then
+ if [ ! -f "$CONFILE" ]; then
+ yes="y"
+ else
+ yes="skip"
+ fi
+elif [ -f "$IGNORE_AGE" ]; then
+ echo "you don't want to be bothered with the age of your $CONFILE file"
+ yes="n"
+elif [ ! -f "$CONFILE" ] || [ "$CONF" -nt "$CONFILE" ]; then
+ if [ -f "$CONFILE" ]; then
+ echo "An older $MODULE configuration file already exists ($CONFILE)"
+ echo "Do you wish to copy the $CONF file in this distribution"
+ echo "to $CONFILE ? (y/n) [skip] "
+ read yes
+ else
+ yes="y"
+ fi
+else
+ yes="skip"
+fi
+
+if [ "$yes" = "y" ]; then
+ mkdir -p $CONFD
+ echo " copying $CONF to $CONFILE"
+ cp $CONF $CONFILE
+else
+ echo " Skipping $CONF installation"
+ if [ "$yes" = "n" ]; then
+ touch "$IGNORE_AGE"
+ fi
+fi
+
+echo
+
+exit 0