Skip to content
Snippets Groups Projects
Commit 2a9ff620 authored by efer's avatar efer
Browse files

rename/check comp-backup.service

parent 01970607
Branches
No related tags found
No related merge requests found
...@@ -668,7 +668,6 @@ elif [ $SYSTEMD = 1 ]; then ...@@ -668,7 +668,6 @@ elif [ $SYSTEMD = 1 ]; then
if [ -f $UNIT_DIR/$SCRIPTNAME-$RUSER.timer ]; then if [ -f $UNIT_DIR/$SCRIPTNAME-$RUSER.timer ]; then
mv $UNIT_DIR/$SCRIPTNAME-$USER.timer $UNIT_DIR/$SCRIPTNAME.timer mv $UNIT_DIR/$SCRIPTNAME-$USER.timer $UNIT_DIR/$SCRIPTNAME.timer
sed -i "s/$SCRIPTNAME-$RUSER/$SCRIPTNAME/" $UNIT_DIR/$SCRIPTNAME.timer sed -i "s/$SCRIPTNAME-$RUSER/$SCRIPTNAME/" $UNIT_DIR/$SCRIPTNAME.timer
sed -i "s/$SCRIPTNAME-$RUSER/$SCRIPTNAME/" $UNIT_DIR/$SCRIPTNAME.service
elif [ ! -f $UNIT_DIR/$SCRIPTNAME.timer ]; then elif [ ! -f $UNIT_DIR/$SCRIPTNAME.timer ]; then
cat > $UNIT_DIR/$SCRIPTNAME.timer << EOF cat > $UNIT_DIR/$SCRIPTNAME.timer << EOF
[Unit] [Unit]
...@@ -682,7 +681,11 @@ Unit=$SCRIPTNAME.service ...@@ -682,7 +681,11 @@ Unit=$SCRIPTNAME.service
[Install] [Install]
WantedBy=timers.target WantedBy=timers.target
EOF EOF
fi
if [ -f $UNIT_DIR/$SCRIPTNAME-$RUSER.service ]; then
mv $UNIT_DIR/$SCRIPTNAME-$USER.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 cat > $UNIT_DIR/$SCRIPTNAME.service << EOF
[Unit] [Unit]
Description=DTU Compute backup script Description=DTU Compute backup script
...@@ -761,7 +764,7 @@ fi ...@@ -761,7 +764,7 @@ fi
# #
echo -e $P_"\nDone setting up DTU Compute backup script!\n"$_N echo -e $P_"\nDone setting up DTU Compute backup script!\n"$_N
echo -e "The script can always be started manually with the command:" $G_"comp-backup\n"$_N echo -e "The script can always be started manually with the command:" $G_"comp-backup\n"$_N
echo -e "Please take a look at the file $CONF_DIR/filter\n" echo -e $Y_"Please take a look at the file:"$_N "$CONF_DIR/filter\n"
# Close the terminal # Close the terminal
read -p $'Press Enter/Return to close the terminal session...\n' read -p $'Press Enter/Return to close the terminal session...\n'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment