Commit 65ce759b authored by Bob Mottram's avatar Bob Mottram

Avoid nesting

parent 5589d4f2
......@@ -385,24 +385,24 @@ shift
done
if [ "$REMOVE_DAEMON" ]; then
if [ -f "/etc/systemd/system/${REMOVE_DAEMON}.service" ]; then
systemctl stop "${REMOVE_DAEMON}.service"
systemctl disable "${REMOVE_DAEMON}.service"
rm "/etc/systemd/system/${REMOVE_DAEMON}.service"
fi
if [ -f "/etc/systemd/system/${REMOVE_DAEMON}.timer" ]; then
systemctl stop "${REMOVE_DAEMON}.timer"
systemctl disable "${REMOVE_DAEMON}.timer"
rm "/etc/systemd/system/${REMOVE_DAEMON}.timer"
fi
if [ -d "/etc/$APP_NAME/$REMOVE_DAEMON" ]; then
if [ -f "/etc/systemd/system/${REMOVE_DAEMON}.service" ]; then
systemctl stop "${REMOVE_DAEMON}.service"
systemctl disable "${REMOVE_DAEMON}.service"
rm "/etc/systemd/system/${REMOVE_DAEMON}.service"
fi
if [ -f "/etc/systemd/system/${REMOVE_DAEMON}.timer" ]; then
systemctl stop "${REMOVE_DAEMON}.timer"
systemctl disable "${REMOVE_DAEMON}.timer"
rm "/etc/systemd/system/${REMOVE_DAEMON}.timer"
fi
rm -rf "/etc/${APP_NAME:?}/$REMOVE_DAEMON"
if [ -d "/etc/${APP_NAME}/${REMOVE_DAEMON}-build" ]; then
rm -rf "/etc/${APP_NAME}/${REMOVE_DAEMON}-build"
fi
if [ -f "/etc/${APP_NAME}/${REMOVE_DAEMON}_build.log" ]; then
rm "/etc/${APP_NAME}/${REMOVE_DAEMON}_build.log"
fi
fi
if [ -d "/etc/${APP_NAME}/${REMOVE_DAEMON}-build" ]; then
rm -rf "/etc/${APP_NAME}/${REMOVE_DAEMON}-build"
fi
if [ -f "/etc/${APP_NAME}/${REMOVE_DAEMON}_build.log" ]; then
rm "/etc/${APP_NAME}/${REMOVE_DAEMON}_build.log"
fi
exit 0
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment