summaryrefslogtreecommitdiff
path: root/daemons/rc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'daemons/rc.sh')
-rw-r--r--daemons/rc.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/daemons/rc.sh b/daemons/rc.sh
index f273bb36..75afa4df 100644
--- a/daemons/rc.sh
+++ b/daemons/rc.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
PATH=/bin:/sbin
swapon -a
@@ -51,28 +51,31 @@ if test -d /tmp; then
# Forcibly remove all translators in the directory.
# It is then safe to attempt to remove files and descend directories.
+ # All parameters must begin with "./".
function remove_translators() {
local f
for f; do
- f="./$f"
settrans -pagfS "$f"
if [ -L "$f" ] || [ ! -d "$f" ]; then
rm "$f"
else
- remove_translators "$f"
+ remove_translators "$f"/* "$f"/.[!.] "$f"/.??*
rmdir "$f"
fi
done
}
(cd /tmp
+ shopt -s nullglob
for f in * .[!.] .??*; do
case "$f" in
'lost+found'|'quotas') ;;
- *) remove_translators "$f"
+ *) remove_translators "./$f"
esac
done)
+ unset -f remove_translators # because it relies on nullglob
+
fi
if test -d /var/run; then
(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })