update scripts
This commit is contained in:
1 parent
95e2551110
commit
4a8ea1b190
17 files changed
+381
-126
No files matched your search
@@ -35,13 +35,19 @@ rc() {
|
|||||||
#--- restart function ---
|
#--- restart function ---
|
||||||
restart() {
|
restart() {
|
||||||
$0 stop
|
$0 stop
|
||||||
|
sleep 1
|
||||||
$0 start
|
$0 start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reload() {
|
||||||
|
restart
|
||||||
|
}
|
||||||
#------------------------
|
#------------------------
|
||||||
|
|
||||||
#--- help function ---
|
#--- help function ---
|
||||||
help() {
|
help() {
|
||||||
echo "$0 init script usage: $0 {start|stop|restart|reload}"
|
echo "$0 init script usage: $0 {start|stop|restart|reload|help}"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
#---------------------
|
#---------------------
|
||||||
|
|
||||||
@@ -54,3 +60,9 @@ check() {
|
|||||||
printf "$BBLUE**$BGREEN SUCCESS: $2\n$RESET"
|
printf "$BBLUE**$BGREEN SUCCESS: $2\n$RESET"
|
||||||
}
|
}
|
||||||
#-----------------------------------------------
|
#-----------------------------------------------
|
||||||
|
|
||||||
|
#--- notify func ---
|
||||||
|
notify() {
|
||||||
|
printf "$BBLUE**$BYELLOW $1\n$RESET"
|
||||||
|
}
|
||||||
|
#-------------------
|
||||||
@@ -5,21 +5,25 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting dnsd"
|
||||||
|
/usr/bin/dnsd -d -c /etc/dnsd.conf
|
||||||
|
check $? "start dnsd"
|
||||||
|
echo $(pgrep dnsd) > /var/run/dnsd.pid
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping dnsd"
|
||||||
|
kill $(cat /var/run/dnsd.pid)
|
||||||
|
check $? "stop dnsd"
|
||||||
|
rm /var/run/dnsd.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Starting dnsd\n$RESET"
|
"$1"
|
||||||
/usr/bin/dnsd -d -c /etc/dnsd.conf
|
|
||||||
check $? "start dnsd"
|
|
||||||
echo $(pgrep dnsd) > /var/run/dnsd.pid
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
printf "$BBLUE**$BYELLOW Stopping dnsd\n$RESET"
|
|
||||||
kill $(cat /var/run/dnsd.pid)
|
|
||||||
check $? "stop dnsd"
|
|
||||||
rm /var/run/dnsd.pid
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
@@ -5,20 +5,24 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting dnsmasq"
|
||||||
|
/usr/bin/dnsmasq --user=dnsmasq --pid-file=/var/run/dnsmasq.pid
|
||||||
|
check $? "start dnsmasq"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping dnsmasq"
|
||||||
|
kill $(cat /var/run/dnsmasq.pid)
|
||||||
|
check $? "stop dnsmasq"
|
||||||
|
rm /var/run/dnsmasq.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Starting dnsmasq\n$RESET"
|
"$1"
|
||||||
/usr/bin/dnsmasq --user=dnsmasq --pid-file=/var/run/dnsmasq.pid
|
|
||||||
check $? "start dnsmasq"
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
printf "$BBLUE**$BYELLOW Stopping dnsmasq\n$RESET"
|
|
||||||
kill $(cat /var/run/dnsmasq.pid)
|
|
||||||
check $? "stop dnsmasq"
|
|
||||||
rm /var/run/dnsmasq.pid &> /dev/null
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
@@ -5,21 +5,25 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting ftpd"
|
||||||
|
tcpsvd -vE 0.0.0.0 21 ftpd -w -S -A /srv/ftpd &>/dev/null &
|
||||||
|
check $? "start ftpd"
|
||||||
|
echo $(pgrep tcpsvd) > /ar/run/ftpd.pid
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping ftpd"
|
||||||
|
kill $(cat /var/run/ftpd.pid)
|
||||||
|
check $? "stop ftpd"
|
||||||
|
rm /var/run/ftpd.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Starting ftpd\n$RESET"
|
"$1"
|
||||||
tcpsvd -vE 0.0.0.0 21 ftpd -w -S -A /srv/ftpd &>/dev/null &
|
|
||||||
check $? "start ftpd"
|
|
||||||
echo $(pgrep tcpsvd) > /ar/run/ftpd.pid
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
printf "$BBLUE**$BYELLOW Stopping ftpd\n$RESET"
|
|
||||||
kill $(cat /var/run/ftpd.pid)
|
|
||||||
check $? "stop ftpd"
|
|
||||||
rm /var/run/ftpd.pid
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
Executable
+40
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#--- import colors and init-funcs ---
|
||||||
|
. /usr/lib/init/colors.sh
|
||||||
|
. /usr/lib/init/init-funcs.sh
|
||||||
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting hostapd"
|
||||||
|
if [ "$2" = "" ]; then
|
||||||
|
/usr/bin/hostapd -P /var/run/hostapd.pid /etc/hostapd/hostapd
|
||||||
|
check $? "start hostapd"
|
||||||
|
else
|
||||||
|
/usr/bin/hostapd -P /var/run/hostapd.pid $2
|
||||||
|
check $? "start hostapd"
|
||||||
|
fi
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping hostapd"
|
||||||
|
if [ ! -f /var/run/hostapd.pid ]; then
|
||||||
|
notify "$RESET[$RED Dnsmasq is not running $RESET]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
kill $(cat /var/run/hostapd.pid)
|
||||||
|
check $? "stop hostapd"
|
||||||
|
rm /var/run/hostapd.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|stop|restart|reload|help)
|
||||||
|
"$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return $?
|
||||||
@@ -5,15 +5,20 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Settin up hostname"
|
||||||
|
/usr/bin/hosname -F /etc/hostname
|
||||||
|
check $? "Set up hostname"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Setting up hostname\n$RESET"
|
"$1"
|
||||||
/usr/bin/hosname -F /etc/hostname
|
|
||||||
check $? "Set up hostname"
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
@@ -5,21 +5,25 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
otify "Starting httpd"
|
||||||
|
/usr/bin/httpd -h /srv/www
|
||||||
|
check $? "start httpd"
|
||||||
|
echo $(pgrep httpd) > /var/run/httpd.pid
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping httpd"
|
||||||
|
kill $(cat /var/run/httpd.pid)
|
||||||
|
check $? "stop httpd"
|
||||||
|
rm /var/run/httpd.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Starting httpd\n$RESET"
|
"$1"
|
||||||
/usr/bin/httpd -h /srv/www
|
|
||||||
check $? "start httpd"
|
|
||||||
echo $(pgrep httpd) > /var/run/httpd.pid
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
printf "$BBLUE**$BYELLOW Stopping httpd\n$RESET"
|
|
||||||
kill $(cat /var/run/httpd.pid)
|
|
||||||
check $? "stop httpd"
|
|
||||||
rm /var/run/httpd.pid
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
Executable
+40
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#--- import colors and init-funcs ---
|
||||||
|
. /usr/lib/init/colors.sh
|
||||||
|
. /usr/lib/init/init-funcs.sh
|
||||||
|
#------------------------------------
|
||||||
|
|
||||||
|
DAEMON="iptables"
|
||||||
|
IPTABLES_ARGS=""
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting $DAEMON"
|
||||||
|
iptables-restore /etc/iptables.conf
|
||||||
|
check $? "start $DAEMON"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop () {
|
||||||
|
notify "Stopping $DAEMON"
|
||||||
|
iptables -F
|
||||||
|
check $? "stop $DAEMON"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
save() {
|
||||||
|
notify "Saving %s: $DAEMON"
|
||||||
|
iptables-save -f /etc/iptables.conf
|
||||||
|
check $? "saving %s: $DAEMON"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|stop|restart|reload|save|help)
|
||||||
|
"$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return $?
|
||||||
@@ -5,20 +5,24 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting klogd"
|
||||||
|
/usr/bin/klogd
|
||||||
|
check $? "start klogd"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping klogd"
|
||||||
|
kill $(cat /var/run/klogd.pid)
|
||||||
|
check $? "stop klogd"
|
||||||
|
rm /var/run/klogd.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Starting klogd\n$RESET"
|
"$1"
|
||||||
/usr/bin/klogd
|
|
||||||
check $? "start klogd"
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
printf "$BBLUE**$BYELLOW Stopping klogd\n$RESET"
|
|
||||||
kill $(cat /var/run/klogd.pid)
|
|
||||||
check $? "stop klogd"
|
|
||||||
rm /var/run/klogd.pid &> /dev/null
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
@@ -5,23 +5,25 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting networking"
|
||||||
|
/usr/bin/ifup -a
|
||||||
|
check $? "networking"
|
||||||
|
echo $! > /var/run/networking.pid
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping networking"
|
||||||
|
/usr/bin/ifdown -a
|
||||||
|
check $? "Stop networking"
|
||||||
|
rm /var/run/networking.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Starting networking\n$RESET"
|
"$1"
|
||||||
/usr/bin/ifup -a
|
|
||||||
check $? "networking"
|
|
||||||
echo $! > /var/run/networking.pid
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
printf "$BBLUE**$BYELLOW Stopping netowrking\n$RESET"
|
|
||||||
/usr/bin/ifdown -a
|
|
||||||
check $? "Stop networking"
|
|
||||||
if [ -f /var/run/neworking.pid ]; then
|
|
||||||
rm /var/run/networking.pid
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
Executable
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#--- import colors and init-funcs ---
|
||||||
|
. /usr/lib/init/colors.sh
|
||||||
|
. /usr/lib/init/init-funcs.sh
|
||||||
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting nginx"
|
||||||
|
nginx
|
||||||
|
check $? "start nginx"
|
||||||
|
echo $(pgrep nginx) > /var/run/nginx.pid
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping nginx"
|
||||||
|
nginx -s stop
|
||||||
|
check $? "stop nginx"
|
||||||
|
rm /var/run/nginx.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|stop|restart|reload)
|
||||||
|
"$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return $?
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#--- import colors and init-funcs ---
|
||||||
|
. /usr/lib/init/colors.sh
|
||||||
|
. /usr/lib/init/init-funcs.sh
|
||||||
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting openrouter software"
|
||||||
|
/usr/bin/auth_service &>/dev/null
|
||||||
|
check $? "start auth_service"
|
||||||
|
echo $(pgrep auth_service) > /var/run/auth_service.pid
|
||||||
|
/usr/bin/openrouter &> /dev/null
|
||||||
|
check $? "start openrouter"
|
||||||
|
echo $(pgrep openrouter) > /var/run/openrouter.pid
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping openrouter software"
|
||||||
|
kill $(cat /var/run/auth_service.pid)
|
||||||
|
check $? "stop auth_service"
|
||||||
|
kill $(cat /var/run/openrouter.pid)
|
||||||
|
check $? "stop openrouter"
|
||||||
|
rm /var/run/{auth_service.pid,openrouter.pid} &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|stop|restart|reload|help)
|
||||||
|
"$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return $?
|
||||||
Executable
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#--- import colors and init-funcs ---
|
||||||
|
. /usr/lib/init/colors.sh
|
||||||
|
. /usr/lib/init/init-funcs.sh
|
||||||
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting sshd"
|
||||||
|
/usr/bin/sshd -D &
|
||||||
|
check $? "start sshd"
|
||||||
|
echo $(pgrep sshd) > /var/run/sshd.pid
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping sshd"
|
||||||
|
kill $(cat /var/run/sshd.pid)
|
||||||
|
check $? "stop sshd"
|
||||||
|
rm /var/run/sshd.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|stop|restart|reload|help)
|
||||||
|
"$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return $?
|
||||||
Executable
+27
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#--- import colors and init-funcs ---
|
||||||
|
. /usr/lib/init/colors.sh
|
||||||
|
. /usr/lib/init/init-funcs.sh
|
||||||
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Setting up sysctl"
|
||||||
|
sysctl -p & /dev/null
|
||||||
|
check $? "setting up sysctl"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start|stop|restart|reload|help)
|
||||||
|
"$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return $?
|
||||||
@@ -5,20 +5,24 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting syslogd"
|
||||||
|
/usr/bin/syslogd
|
||||||
|
check $? "start syslogd"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping syslogd"
|
||||||
|
kill $(cat /var/run/syslogd.pid)
|
||||||
|
check $? "stop syslogd"
|
||||||
|
rm /var/run/syslogd.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Starting syslogd\n$RESET"
|
"$1"
|
||||||
/usr/bin/syslogd
|
|
||||||
check $? "start syslogd"
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
printf "$BBLUE**$BYELLOW Stopping syslogd\n$RESET"
|
|
||||||
kill $(cat /var/run/syslogd.pid)
|
|
||||||
check $? "stop syslogd"
|
|
||||||
rm /var/run/syslogd.pid &> /dev/null
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
@@ -5,21 +5,25 @@
|
|||||||
. /usr/lib/init/init-funcs.sh
|
. /usr/lib/init/init-funcs.sh
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
|
|
||||||
|
start() {
|
||||||
|
notify "Starting telnetd"
|
||||||
|
/usr/bin/telnetd -p 23
|
||||||
|
check $? "start telnetd"
|
||||||
|
echo $(gprep telnetd) > /var/run/telnetd.pid
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
notify "Stopping telnetd"
|
||||||
|
kill $(cat /var/run/telnetd.pid)
|
||||||
|
check $? "stop telnetd"
|
||||||
|
rm /var/run/telnetd.pid &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start|stop|restart|reload|help)
|
||||||
printf "$BBLUE**$BYELLOW Starting telnetd\n$RESET"
|
"$1"
|
||||||
/usr/bin/telnetd -p 23
|
|
||||||
check $? "start telnetd"
|
|
||||||
echo $(gprep telnetd) > /var/run/telnetd.pid
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
printf "$BBLUE**$BYELLOW Stopping telnetd\n$RESET"
|
|
||||||
kill $(cat /var/run/telnetd.pid)
|
|
||||||
check $? "stop telnetd"
|
|
||||||
rm /var/run/telnetd.pid &> /dev/null
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
|
|||||||
+6
-6
@@ -7,10 +7,10 @@
|
|||||||
07dnsmasq
|
07dnsmasq
|
||||||
08dnsd
|
08dnsd
|
||||||
09telnetd
|
09telnetd
|
||||||
10ssh
|
10sshd
|
||||||
11iptables
|
11iptables
|
||||||
12openrouterinit
|
12ftpd
|
||||||
13ftpd
|
13hostapd
|
||||||
14hostapd
|
14httpd
|
||||||
15httpd
|
15nginx
|
||||||
16nginx
|
16openrouterinit
|
||||||
Reference in new issue
Block a user