added configs and services and dropbear
This commit is contained in:
1 parent
0fddbb33f2
commit
0ba5024474
27 files changed
+149
-12
No files matched your search
+7
-7
@@ -12,7 +12,7 @@
|
||||
## ## ##
|
||||
|
||||
#---------------- variables --------------------------
|
||||
rootdir=$(pwd)
|
||||
rootdir=/
|
||||
repofile=$rootdir/etc/pm/repo
|
||||
packagesqueryfile=$rootdir/usr/share/pm/query
|
||||
reposquerydir=$rootdir/usr/share/pm/repos
|
||||
@@ -245,22 +245,22 @@ clear() {
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
case "$1" in
|
||||
add)
|
||||
add|a|-a)
|
||||
add $*
|
||||
;;
|
||||
down)
|
||||
down|download)
|
||||
down $2
|
||||
;;
|
||||
unpack)
|
||||
unpack|u|-u)
|
||||
unpack $2
|
||||
;;
|
||||
del)
|
||||
del|d|-d)
|
||||
del $*
|
||||
;;
|
||||
list)
|
||||
list|l|-l)
|
||||
list $2
|
||||
;;
|
||||
query)
|
||||
query|q|-q)
|
||||
query
|
||||
;;
|
||||
help)
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
## ##########
|
||||
## ##########
|
||||
|
||||
rootdir=$(pwd)
|
||||
rootdir=/
|
||||
|
||||
#----- colors -------
|
||||
. $rootdir/usr/lib/init/colors.sh
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
#-------------------
|
||||
Executable
+38
@@ -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 $?
|
||||
Regular → Executable
File mode changed.
+2
-1
@@ -13,4 +13,5 @@
|
||||
13hostapd
|
||||
14httpd
|
||||
15nginx
|
||||
16openrouterinit
|
||||
16openrouterinit
|
||||
17dropbear
|
||||
Reference in new issue
Block a user