Skip to content

Commit

Permalink
Use start_if_stopped instead of just service start (nextcloud#1608)
Browse files Browse the repository at this point in the history
Signed-off-by: enoch85 <[email protected]>
  • Loading branch information
enoch85 authored Oct 19, 2020
1 parent 7e1858d commit cbc2c80
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/bitwarden-rs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ findtime = 1800
ignoreip = 127.0.0.1/8 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8
BWA_JAIL_CONF

check_command systemctl start fail2ban
start_if_stopped fail2ban
countdown "Waiting for fail2ban to start... " 5
check_command fail2ban-client reload

Expand Down
2 changes: 1 addition & 1 deletion apps/bitwarden_mailconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ then
fi

# Start Bitwarden
systemctl start bitwarden
start_if_stopped bitwarden
msg_box "Your Bitwarden mailserver settings should be successfully changed by now.
If you experience any issues, please report them to $ISSUES"
Expand Down
2 changes: 1 addition & 1 deletion apps/clamav.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ apt install clamav clamav-freshclam clamav-daemon -y
# stop freshclam and update the database
check_command systemctl stop clamav-freshclam
check_command freshclam
check_command systemctl start clamav-freshclam
start_if_stopped clamav-freshclam

# Edit ClamAV settings to fit the installation
sed -i "s|^MaxDirectoryRecursion.*|MaxDirectoryRecursion 30|" /etc/clamav/clamd.conf
Expand Down
2 changes: 1 addition & 1 deletion apps/webmin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ check_command systemctl stop webmin
# Redirect http to https on the LAN IP
check_command sed -i '/^ssl=.*/a ssl_redirect=1' /etc/webmin/miniserv.conf
check_command sed -i "/^port=.*/a host=$ADDRESS" /etc/webmin/miniserv.conf
check_command systemctl start webmin
start_if_stopped webmin

msg_box "Webmin is now installed and can be accessed from this address:
Expand Down
2 changes: 1 addition & 1 deletion disk/change-to-zfs-mount-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ systemctl disable zfs-mount
# FOR ZEDLET
check_command systemctl enable zfs-zed.service
check_command systemctl enable zfs.target
check_command systemctl start zfs-zed.service
start_if_stopped zfs-zed

# Activate config
touch /etc/zfs/zfs-list.cache/"$POOLNAME"
Expand Down
2 changes: 1 addition & 1 deletion lets-encrypt/test-new-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fi
# Check if service is running
if ! pgrep apache2 > /dev/null
then
systemctl start apache2.service
start_if_stopped apache2.service
fi
CRONTAB
}
Expand Down
2 changes: 1 addition & 1 deletion lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ start_if_stopped() {
if ! pgrep "$1"
then
print_text_in_color "$ICyan" "Starting $1..."
check_command systemctl start "$1".service
systemctl start "$1".service
fi
}

Expand Down
8 changes: 4 additions & 4 deletions nextcloud_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ then
nextcloud_occ maintenance:mode --off
if [ -n "$DOCKER" ]
then
check_command systemctl start docker
start_if_stopped docker
fi
notify_admin_gui "Update failed!" \
"Could not remove NcVM-snapshot - Please reboot your server! $(date +%T)"
Expand All @@ -74,7 +74,7 @@ This should work again after a reboot of your server."
nextcloud_occ maintenance:mode --off
if [ -n "$DOCKER" ]
then
check_command systemctl start docker
start_if_stopped docker
fi
notify_admin_gui "Update failed!" \
"Could not create NcVM-snapshot - Please reboot your server! $(date +%T)"
Expand All @@ -86,7 +86,7 @@ It should work afterwards again."
nextcloud_occ maintenance:mode --off
if [ -n "$DOCKER" ]
then
check_command systemctl start docker
start_if_stopped docker
fi
fi

Expand Down Expand Up @@ -696,7 +696,7 @@ then
if ! pgrep postgres >/dev/null 2>&1
then
print_text_in_color "$ICyan" "Starting PostgreSQL..."
check_command systemctl start postgresql.service
systemctl start postgresql.service
fi
fi

Expand Down

0 comments on commit cbc2c80

Please sign in to comment.