fix errors and warnings in scripts

This commit is contained in:
wt committed 2024-11-01 15:33:36 +07:00
1 parent 4a8ea1b190
commit 3341df9c89
8 files changed
+12 -12

No files matched your search

+1 -1
View File
@@ -63,6 +63,6 @@ check() {
#--- notify func --- #--- notify func ---
notify() { notify() {
printf "$BBLUE**$BYELLOW $1\n$RESET" printf "$BBLUE**$BGREEN $1\n$RESET"
} }
#------------------- #-------------------
+1 -1
View File
@@ -9,7 +9,7 @@ start() {
notify "Starting ftpd" notify "Starting ftpd"
tcpsvd -vE 0.0.0.0 21 ftpd -w -S -A /srv/ftpd &>/dev/null & tcpsvd -vE 0.0.0.0 21 ftpd -w -S -A /srv/ftpd &>/dev/null &
check $? "start ftpd" check $? "start ftpd"
echo $(pgrep tcpsvd) > /ar/run/ftpd.pid echo $(pgrep tcpsvd) > /var/run/ftpd.pid
return $? return $?
} }
+1 -1
View File
@@ -7,7 +7,7 @@
start() { start() {
notify "Settin up hostname" notify "Settin up hostname"
/usr/bin/hosname -F /etc/hostname /usr/bin/hostname -F /etc/hostname
check $? "Set up hostname" check $? "Set up hostname"
return $? return $?
} }
+1 -1
View File
@@ -28,4 +28,4 @@ case "$1" in
help help
;; ;;
esac esac
reurn $? return $?
+4 -4
View File
@@ -7,12 +7,12 @@
start() { start() {
notify "Starting openrouter software" notify "Starting openrouter software"
/usr/bin/auth_service &>/dev/null /usr/bin/auth_service &>/dev/null &
check $? "start auth_service" check $? "start auth_service"
echo $(pgrep auth_service) > /var/run/auth_service.pid echo $! > /var/run/auth_service.pid
/usr/bin/openrouter &> /dev/null /usr/bin/openrouter &> /dev/null &
check $? "start openrouter" check $? "start openrouter"
echo $(pgrep openrouter) > /var/run/openrouter.pid echo $! > /var/run/openrouter.pid
return $? return $?
} }
+1 -1
View File
@@ -9,7 +9,7 @@ start() {
notify "Starting sshd" notify "Starting sshd"
/usr/bin/sshd -D & /usr/bin/sshd -D &
check $? "start sshd" check $? "start sshd"
echo $(pgrep sshd) > /var/run/sshd.pid echo $! > /var/run/sshd.pid
return $? return $?
} }
+1 -1
View File
@@ -7,7 +7,7 @@
start() { start() {
notify "Setting up sysctl" notify "Setting up sysctl"
sysctl -p & /dev/null sysctl -p &> /dev/null
check $? "setting up sysctl" check $? "setting up sysctl"
return $? return $?
} }
+2 -2
View File
@@ -9,13 +9,13 @@ start() {
notify "Starting telnetd" notify "Starting telnetd"
/usr/bin/telnetd -p 23 /usr/bin/telnetd -p 23
check $? "start telnetd" check $? "start telnetd"
echo $(gprep telnetd) > /var/run/telnetd.pid echo $(pgrep telnetd) > /var/run/telnetd.pid
return $? return $?
} }
stop() { stop() {
notify "Stopping telnetd" notify "Stopping telnetd"
kill $(cat /var/run/telnetd.pid) kill $(cat /var/run/telnetd.pid | awk '{ print $2 }')
check $? "stop telnetd" check $? "stop telnetd"
rm /var/run/telnetd.pid &> /dev/null rm /var/run/telnetd.pid &> /dev/null
return $? return $?