added configs and services and dropbear

This commit is contained in:
wt committed 2024-11-02 11:06:54 +07:00
1 parent 0fddbb33f2
commit 0ba5024474
27 files changed
+149 -12

No files matched your search

+3 -3
View File
@@ -54,15 +54,15 @@ help() {
#------------ check status function ------------
check() {
if [ $1 -ne 0 ]; then
printf "$BBLUE**$BRED ERROR: $2\n$RESET"
printf "$BBLUE**$BWHITE $2 [$BRED ERROR $RESET]\n$RESET"
return
fi
printf "$BBLUE**$BGREEN SUCCESS: $2\n$RESET"
printf "$BBLUE**$BWHITE $2 [$BGREEN SUCCESS $RESET]\n$RESET"
}
#-----------------------------------------------
#--- notify func ---
notify() {
printf "$BBLUE**$BGREEN $1\n$RESET"
printf "$BBLUE**$BWHITE $1\n$RESET"
}
#-------------------
+38
View File
@@ -0,0 +1,38 @@
#!/bin/sh
#--- import colors and init-funcs ---
. /usr/lib/init/colors.sh
. /usr/lib/init/init-funcs.sh
#------------------------------------
. /etc/default/dropbear
ENABLE_ROOT_LOGIN_ARGS=""
if [ "$ENABLE_ROOT_LOGIN" = "no" ]; then
ENABLE_ROOT_LOGIN_ARGS="-w -g"
fi
start() {
notify "Starting dropbear"
/usr/bin/dropbear -P /var/run/dropbear.pid $DROPBEAR_EXTRA_ARGS $ENABLE_ROOT_LOGIN_ARGS -p $DROPBEAR_PORT &> /var/log/dropbear.log
check $? "start dropbear"
return $?
}
stop() {
notify "Stopping dropbear"
kill $(cat /var/run/dropbear.pid)
check $? "stop dropbear"
return $?
}
case "$1" in
start|stop|restart|reload|help)
"$1"
;;
*)
help
;;
esac
return $?
View File
File mode changed.