add caddy reload and restart commands
This commit is contained in:
parent
afdc95bbb1
commit
233ed6e75c
1 changed files with 38 additions and 0 deletions
38
helperbot
38
helperbot
|
|
@ -125,6 +125,13 @@ function info_help {
|
||||||
echo "${bold}--update-helperbot${normal}"
|
echo "${bold}--update-helperbot${normal}"
|
||||||
echo " Create a backup of the current helperbot into ${underline}/usr/local/bin/helperbot.bak${normal} and does an in-place upgrade of itself."
|
echo " Create a backup of the current helperbot into ${underline}/usr/local/bin/helperbot.bak${normal} and does an in-place upgrade of itself."
|
||||||
echo
|
echo
|
||||||
|
echo "${cyan}${bold}${underline}Caddy:${normal}"
|
||||||
|
echo "${bold}--caddy-reload${normal}"
|
||||||
|
echo " (Live-)Reload the Caddy configurations."
|
||||||
|
echo
|
||||||
|
echo "${bold}--caddy-restart${normal}"
|
||||||
|
echo " Restart the Caddy container."
|
||||||
|
echo
|
||||||
echo "${cyan}${bold}${underline}Fediverse:${normal}"
|
echo "${cyan}${bold}${underline}Fediverse:${normal}"
|
||||||
echo "${bold}--sync-blocklists${normal}"
|
echo "${bold}--sync-blocklists${normal}"
|
||||||
echo " Import blocklist from Sharkey -> Iceshrimp"
|
echo " Import blocklist from Sharkey -> Iceshrimp"
|
||||||
|
|
@ -743,6 +750,31 @@ function fedi_update_frontends {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ╭──────────────╮
|
||||||
|
# │ reload caddy │
|
||||||
|
# ╰──────────────╯
|
||||||
|
function caddy_reload {
|
||||||
|
local caddy_name=caddy
|
||||||
|
|
||||||
|
# TODO: should we implement some sort of error checking here? in either case this will fail the entire script anyways if caddy isn't running and verbally reports that, so probably not required.
|
||||||
|
echo "${blue}caddy:${normal} Reloading Caddy..."
|
||||||
|
docker compose exec -w /etc/caddy $caddy_name caddy reload
|
||||||
|
echo "${green}Reloaded.${normal}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ╭───────────────╮
|
||||||
|
# │ restart caddy │
|
||||||
|
# ╰───────────────╯
|
||||||
|
function caddy_restart {
|
||||||
|
local caddy_dir=/srv/docker/caddy
|
||||||
|
|
||||||
|
# TODO: see note for caddy_reload
|
||||||
|
echo "${blue}caddy:${normal} Restarting Caddy..."
|
||||||
|
docker compose -f $caddy_dir/compose.yaml down
|
||||||
|
docker compose -f $caddy_dir/compose.yaml up -d
|
||||||
|
echo "${green}Restarted.${normal}"
|
||||||
|
}
|
||||||
|
|
||||||
# ╭────────────────────────────────────╮
|
# ╭────────────────────────────────────╮
|
||||||
# │ functions and variables - end here │
|
# │ functions and variables - end here │
|
||||||
# ╰────────────────────────────────────╯
|
# ╰────────────────────────────────────╯
|
||||||
|
|
@ -800,6 +832,12 @@ while [ -n "$1" ]; do
|
||||||
--update-helperbot) # update helperbot
|
--update-helperbot) # update helperbot
|
||||||
root_check
|
root_check
|
||||||
update_helperbot;;
|
update_helperbot;;
|
||||||
|
--caddy-reload) # reload caddy
|
||||||
|
root_check
|
||||||
|
caddy_reload;;
|
||||||
|
--caddy-restart) # restart caddy
|
||||||
|
root_check
|
||||||
|
caddy_restart;;
|
||||||
--sync-blocklists) # fediverse: sync sharkey -> iceshrimp blocklists
|
--sync-blocklists) # fediverse: sync sharkey -> iceshrimp blocklists
|
||||||
if [ ! -v synth_current_system ]; then
|
if [ ! -v synth_current_system ]; then
|
||||||
detect_system
|
detect_system
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue