mirror of https://github.com/tLDP/LDP
use external install script, ask user whether to overwrite the
configuration file.
This commit is contained in:
parent
88f2cc719e
commit
9e3c693cf3
|
@ -1,13 +1,9 @@
|
|||
confprefix = /etc
|
||||
|
||||
INSTALLCONF = install -p -m 644 --backup=simple
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
|
||||
install: all
|
||||
$(INSTALLCONF) lampadas.conf $(confprefix)/lampadas.conf
|
||||
install.sh
|
||||
|
||||
clean:
|
||||
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Installs the configuration file
|
||||
#
|
||||
|
||||
confprefix=/etc
|
||||
|
||||
INSTALLCONF="install -p -m 644 --backup=simple"
|
||||
|
||||
newconf=N
|
||||
|
||||
if [ -f $confprefix/lampadas.conf ]; then
|
||||
echo "Installation will overwrite your configuration file,"
|
||||
echo "but it will make a backup in lampadas.conf~."
|
||||
echo ""
|
||||
echo "Do you want to install a new configuration file? (y/n):"
|
||||
|
||||
read newconf
|
||||
|
||||
if [ "$newconf" = "y" ]; then
|
||||
newconf=Y
|
||||
fi
|
||||
|
||||
if [ "$newconf" = "Y" ]; then
|
||||
doinstall=Y
|
||||
fi
|
||||
else
|
||||
doinstall=Y
|
||||
fi
|
||||
|
||||
if [ "$doinstall" = "Y" ]; then
|
||||
$INSTALLCONF lampadas.conf $confprefix/lampadas.conf
|
||||
echo "The configuration file was installed."
|
||||
if [ "$newconf" = "Y" ]; then
|
||||
echo "The backup file is /etc/lampadas.conf~."
|
||||
fi
|
||||
else
|
||||
echo "The configuration file was not installed."
|
||||
fi
|
||||
|
Loading…
Reference in New Issue