diff options
Diffstat (limited to 'community/socklog/socklog.setup')
-rw-r--r-- | community/socklog/socklog.setup | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/community/socklog/socklog.setup b/community/socklog/socklog.setup new file mode 100644 index 0000000000..cccd06f528 --- /dev/null +++ b/community/socklog/socklog.setup @@ -0,0 +1,42 @@ +#!/bin/sh + +NORMAL="\033[1;0m" +STRONG="\033[1;1m" +RED="\033[1;31m" +GREEN="\033[1;32m" +runscript="/etc/sv/socklog-unix/run" + +print_stop() { + local prompt="${STRONG}$1 ${RED}$2${NORMAL}" + printf "${prompt}" +} + +print_start() { + local prompt="${STRONG}$1 ${GREEN}$2${NORMAL}" + printf "${prompt}" +} + +print_stop "\nSTOP BusyBox Syslog & remove it from the Boot Runlevel ?" "[ Enter, or Y to remove ]: "; read ans +if [ -z "$ans" ] || [ "$ans" = "y" ] || [ "$ans" = "Y" ]; then + printf "\n" + rc-update del syslog boot + rc-service syslog stop + rc-service klogd stop +fi + +print_start "\nSTART & enable socklog with runit ?" "[ Enter, or Y to add ]: "; read ans +if [ -z "$ans" ] || [ "$ans" = "y" ] || [ "$ans" = "Y" ]; then + if [ -f $runscript ] && [ ! -x $runscript ]; then + printf "\nenabling: %s" "$runscript" + chmod 700 $runscript + fi + + if [ ! -x /sbin/runit ]; then + printf "\n" + apk add runit + rc-update add runitd boot + rc-service runitd start + fi +fi + +exit 0 |