mirror of
https://github.com/bashclub/zamba-lxc-toolbox
synced 2026-02-19 07:56:18 +00:00
fix script deletion
This commit is contained in:
12
install.sh
12
install.sh
@@ -20,12 +20,12 @@ prog="$(basename $0)"
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat >&2 <<-EOF
|
cat >&2 <<-EOF
|
||||||
usage: $prog [-h] [-d] [-i CTID] [-s SERVICE] [-c CFGFILE]
|
usage: $prog [-h] [-d] [-i CTID] [-s SERVICE] [-c CFGFILE] [-p]
|
||||||
installs a preconfigured lxc container on your proxmox server
|
installs a preconfigured lxc container on your proxmox server
|
||||||
-i CTID provide a container id instead of auto detection
|
-i CTID provide a container id instead of auto detection
|
||||||
-s SERVICE provide the service name and skip the selection dialog
|
-s SERVICE provide the service name and skip the selection dialog
|
||||||
-c CFGFILE use a different config file than 'zamba.conf'
|
-c CFGFILE use a different config file than 'zamba.conf'
|
||||||
-r remove zamba.conf inside container
|
-p preserve zamba.conf ans scripts inside container
|
||||||
-d Debug mode inside LXC container
|
-d Debug mode inside LXC container
|
||||||
-h displays this help text
|
-h displays this help text
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
@@ -40,15 +40,15 @@ ctid=0
|
|||||||
service=ask
|
service=ask
|
||||||
config=$PWD/conf/zamba.conf
|
config=$PWD/conf/zamba.conf
|
||||||
debug=0
|
debug=0
|
||||||
preserve_install_scripts=1
|
preserve_install_scripts=0
|
||||||
|
|
||||||
while getopts "hi:s:c:dr" opt; do
|
while getopts "hi:s:c:dp" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
h) usage 0 ;;
|
h) usage 0 ;;
|
||||||
i) ctid=$OPTARG ;;
|
i) ctid=$OPTARG ;;
|
||||||
s) service=$OPTARG ;;
|
s) service=$OPTARG ;;
|
||||||
c) config=$OPTARG ;;
|
c) config=$OPTARG ;;
|
||||||
r) preserve_install_scripts=0 ;;
|
p) preserve_install_scripts=1 ;;
|
||||||
d) debug=1 ;;
|
d) debug=1 ;;
|
||||||
*) usage 1 ;;
|
*) usage 1 ;;
|
||||||
esac
|
esac
|
||||||
@@ -229,6 +229,6 @@ fi
|
|||||||
|
|
||||||
if [ $preserve_install_scripts -eq 0 ]; then
|
if [ $preserve_install_scripts -eq 0 ]; then
|
||||||
for f in constants.conf constants-service.conf functions.sh install-service.sh lxc-base.sh zamba.conf; do
|
for f in constants.conf constants-service.conf functions.sh install-service.sh lxc-base.sh zamba.conf; do
|
||||||
pct exec $LXC_NBR -- if [ -f /root/$f ] ; then rm -f /root/${f} ; fi
|
pct exec $LXC_NBR -- bash -c "if [ -f /root/$f ] ; then rm -f /root/${f} ; fi"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user