Fix non-POSIXisms in sample rcboot.sh
authorDavin McCall <davmac@davmac.org>
Sun, 30 Jun 2019 11:49:52 +0000 (21:49 +1000)
committerDavin McCall <davmac@davmac.org>
Fri, 5 Jul 2019 08:33:19 +0000 (18:33 +1000)
doc/linux/services/rcboot.sh

index 8ed73de445bee909ab52023f5a7efaefcabec018..b1d328bd47e5b353447191143db69b0bc63bd0fd 100755 (executable)
@@ -6,9 +6,9 @@ if [ "$1" != "stop" ]; then
   
   # cleanup
   # (delete /tmp etc)
-  rm -rf /tmp/* /tmp/.[^.]* /tmp/..?*
-  rm -rf /var/lock/* /var/lock/.[^.]* /var/lock/..?*
-  rm -rf /var/run/* /var/run/.[^.]* /var/run/..?*
+  rm -rf /tmp/* /tmp/.[!.]* /tmp/..?*
+  rm -rf /var/lock/* /var/lock/.[!.]* /var/lock/..?*
+  rm -rf /var/run/* /var/run/.[!.]* /var/run/..?*
   # create state directories
   : > /var/run/utmp
   mkdir /var/run/dbus
@@ -31,7 +31,7 @@ else
   # The system is being shut down
   
   # echo "Saving random number seed..."
-  POOLSIZE=`cat /proc/sys/kernel/random/poolsize`
+  POOLSIZE="$(cat /proc/sys/kernel/random/poolsize)"
   dd if=/dev/urandom of=/var/state/random-seed bs="$POOLSIZE" count=1 2> /dev/null
 
 fi;