-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrc.local
45 lines (40 loc) · 896 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
44
45
#!/bin/bash -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.
SCRIPTS="/var/scripts"
GITHUB_REPO="https://raw.githubusercontent.com/techandme/Teamspeak-VM/master"
# Create dir
if [ -d $SCRIPTS ];
then
sleep 1
else
mkdir $SCRIPTS
fi
# Get initial script
if [ -f $SCRIPTS/initial.sh ];
then
echo "initial.sh exists"
else
wget -q $GITHUB_REPO/initial.sh -P $SCRIPTS
fi
if [[ $? > 0 ]]
then
echo "Download of script failed. System will reboot in 10 seconds..."
sleep 10
reboot
else
echo "Downloaded initial.sh."
sleep 1
fi
# Execute initial.sh
bash $SCRIPTS/initial.sh
exit 0