-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc.local
43 lines (38 loc) · 907 Bytes
/
rc.local
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
hwclock --systohc
mkdir /etc/runonce.d/ran 2> /dev/null || true
# Scripts which only run once...
for file in /etc/runonce.d/*
do
if [ ! -f "$file" ]
then
continue
fi
chmod 755 "$file"
su - root -c "$file" | tee /var/log/${file##*/}.log
mv "$file" /etc/runonce.d/ran/
logger -t runonce -p local3.info "$file"
done
# Scripts which run every boot
for file in /etc/runboot.d/*
do
if [ ! -f "$file" ]
then
continue
fi
chmod 755 "$file"
su - root -c "$file" | tee /var/log/${file##*/}.log
logger -t runboot -p local3.info "$file"
done
exit 0