mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-14 18:47:00 +05:30
Allow updating singular units
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
3a6e204a00
commit
e8acfeae93
1 changed files with 7 additions and 9 deletions
16
update.sh
16
update.sh
|
@ -10,16 +10,14 @@ function prettyPrint {
|
||||||
# Grab all service names
|
# Grab all service names
|
||||||
declare -a services=('caddy' 'horbiswalls-bot' 'mirror-bot' 'uno-bot')
|
declare -a services=('caddy' 'horbiswalls-bot' 'mirror-bot' 'uno-bot')
|
||||||
|
|
||||||
# Place the systemd unit files where they belong
|
# Now loop through each service and install it
|
||||||
prettyPrint "Copying systemd files to /etc/systemd/system"
|
|
||||||
for service in "${services[@]}"; do sudo cp -v "${service}.service" /etc/systemd/system/; done
|
|
||||||
|
|
||||||
# Reload systemctl so that it processes our changes
|
|
||||||
prettyPrint "Reloading systemctl daemon"
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
|
|
||||||
# Now loop through each service and restart it
|
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
if [ "${1}" ] && [ "${service}" != "${1}" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
prettyPrint "Installing ${service}"
|
||||||
|
sudo cp -v "${service}.service" /etc/systemd/system/
|
||||||
|
sudo systemctl daemon-reload
|
||||||
prettyPrint "Restarting ${service}"
|
prettyPrint "Restarting ${service}"
|
||||||
sudo service "${service}" restart
|
sudo service "${service}" restart
|
||||||
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
|
if [ ! -f "/etc/systemd/system/multi-user.target.wants/${service}.service" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue