fix errors and warnings in scripts

This commit is contained in:
wt
2024-11-01 15:33:36 +07:00
parent 4a8ea1b190
commit 3341df9c89
8 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -63,6 +63,6 @@ check() {
#--- notify func ---
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"
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
echo $(pgrep tcpsvd) > /var/run/ftpd.pid
return $?
}
+1 -1
View File
@@ -7,7 +7,7 @@
start() {
notify "Settin up hostname"
/usr/bin/hosname -F /etc/hostname
/usr/bin/hostname -F /etc/hostname
check $? "Set up hostname"
return $?
}
+1 -1
View File
@@ -28,4 +28,4 @@ case "$1" in
help
;;
esac
reurn $?
return $?
+4 -4
View File
@@ -7,12 +7,12 @@
start() {
notify "Starting openrouter software"
/usr/bin/auth_service &>/dev/null
/usr/bin/auth_service &>/dev/null &
check $? "start auth_service"
echo $(pgrep auth_service) > /var/run/auth_service.pid
/usr/bin/openrouter &> /dev/null
echo $! > /var/run/auth_service.pid
/usr/bin/openrouter &> /dev/null &
check $? "start openrouter"
echo $(pgrep openrouter) > /var/run/openrouter.pid
echo $! > /var/run/openrouter.pid
return $?
}
+1 -1
View File
@@ -9,7 +9,7 @@ start() {
notify "Starting sshd"
/usr/bin/sshd -D &
check $? "start sshd"
echo $(pgrep sshd) > /var/run/sshd.pid
echo $! > /var/run/sshd.pid
return $?
}
+1 -1
View File
@@ -7,7 +7,7 @@
start() {
notify "Setting up sysctl"
sysctl -p & /dev/null
sysctl -p &> /dev/null
check $? "setting up sysctl"
return $?
}
+2 -2
View File
@@ -9,13 +9,13 @@ start() {
notify "Starting telnetd"
/usr/bin/telnetd -p 23
check $? "start telnetd"
echo $(gprep telnetd) > /var/run/telnetd.pid
echo $(pgrep telnetd) > /var/run/telnetd.pid
return $?
}
stop() {
notify "Stopping telnetd"
kill $(cat /var/run/telnetd.pid)
kill $(cat /var/run/telnetd.pid | awk '{ print $2 }')
check $? "stop telnetd"
rm /var/run/telnetd.pid &> /dev/null
return $?