Remove old file on upgrade
This commit is contained in:
parent
116d633096
commit
8a03a3d904
|
@ -33,13 +33,13 @@ UPGRADE_SCRIPT_NAME="${PROJECT_NAME}-upgrade"
|
|||
|
||||
function create_upgrade_script {
|
||||
if [ -f /usr/local/bin/${PROJECT_NAME}-upgrade ]; then
|
||||
cp /usr/local/bin/${PROJECT_NAME}-upgrade /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
|
||||
cp /usr/local/bin/${PROJECT_NAME}-upgrade /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
|
||||
else
|
||||
cp /usr/bin/${PROJECT_NAME}-upgrade /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
|
||||
cp /usr/bin/${PROJECT_NAME}-upgrade /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
|
||||
fi
|
||||
|
||||
if grep -Fxq "create_upgrade_script" $COMPLETION_FILE; then
|
||||
return
|
||||
return
|
||||
fi
|
||||
|
||||
apt-get -y install unattended-upgrades
|
||||
|
@ -49,10 +49,10 @@ function create_upgrade_script {
|
|||
|
||||
function upgrade_installation {
|
||||
if [ ! -f $COMPLETION_FILE ]; then
|
||||
return
|
||||
return
|
||||
fi
|
||||
if grep -Fxq "upgrade_installation" $COMPLETION_FILE; then
|
||||
return
|
||||
return
|
||||
fi
|
||||
|
||||
# upgrade from previous versions to stockholm
|
||||
|
@ -66,6 +66,10 @@ function upgrade_installation {
|
|||
sed -i 's|install_tox_node|install_tox|g' $COMPLETION_FILE
|
||||
sed -i 's|intrusion_detection|install_tripwire|g' $COMPLETION_FILE
|
||||
|
||||
if [ -f /usr/local/bin/zeronetavahi ]; then
|
||||
rm /usr/local/bin/zeronetavahi
|
||||
fi
|
||||
|
||||
echo 'upgrade_installation' >> $COMPLETION_FILE
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue