Skip to content
Snippets Groups Projects
Commit 1eb76ea7 authored by efer's avatar efer
Browse files

disable timer before renaming

parent 2a9ff620
Branches
No related tags found
No related merge requests found
......@@ -666,7 +666,8 @@ EOF
fi
elif [ $SYSTEMD = 1 ]; then
if [ -f $UNIT_DIR/$SCRIPTNAME-$RUSER.timer ]; then
mv $UNIT_DIR/$SCRIPTNAME-$USER.timer $UNIT_DIR/$SCRIPTNAME.timer
systemctl --user disable --now $SCRIPTNAME-$RUSER.timer &>/dev/null
mv $UNIT_DIR/$SCRIPTNAME-$RUSER.timer $UNIT_DIR/$SCRIPTNAME.timer
sed -i "s/$SCRIPTNAME-$RUSER/$SCRIPTNAME/" $UNIT_DIR/$SCRIPTNAME.timer
elif [ ! -f $UNIT_DIR/$SCRIPTNAME.timer ]; then
cat > $UNIT_DIR/$SCRIPTNAME.timer << EOF
......@@ -683,7 +684,7 @@ WantedBy=timers.target
EOF
fi
if [ -f $UNIT_DIR/$SCRIPTNAME-$RUSER.service ]; then
mv $UNIT_DIR/$SCRIPTNAME-$USER.service $UNIT_DIR/$SCRIPTNAME.service
mv $UNIT_DIR/$SCRIPTNAME-$RUSER.service $UNIT_DIR/$SCRIPTNAME.service
sed -i "s/$SCRIPTNAME-$RUSER/$SCRIPTNAME/" $UNIT_DIR/$SCRIPTNAME.service
elif [ ! -f $UNIT_DIR/$SCRIPTNAME.service ]; then
cat > $UNIT_DIR/$SCRIPTNAME.service << EOF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment