-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·57 lines (44 loc) · 1.11 KB
/
install.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
if [ $(id -u) -ne 0 ]; then
printf "This install script needs to be run as root.\n"
exit 1
fi
if [ -z "$1" ]; then {
echo "ERROR: No arguments specified (ubuntu, debian or opensuse)"
exit 1
}
elif [ $1 = "ubuntu" ]; then {
printf "" # Do nothing
}
elif [ $1 = "debian" ]; then {
printf "" # Do nothing
}
elif [ $1 = "opensuse" ]; then {
printf "" # Do nothing
}
else {
echo "ERROR: Unknown distribution specified."
exit 1
}
fi
touch pine64-config.sh
printf "#!/bin/bash\n \n" >> pine64-config.sh
echo "DISTRO=$1" >> pine64-config.sh
if [ $1 = "ubuntu" ]; then {
cat ubuntu/*.sh common/*.sh main.sh >> pine64-config.sh
}
elif [ $1 = "debian" ]; then {
cat debian/*.sh common/*.sh main.sh >> pine64-config.sh
}
elif [ $1 = "opensuse" ]; then {
cat opensuse/*.sh common/*.sh main.sh >> pine64-config.sh
}
fi
if [ -e "/usr/local/sbin/pine64-config.sh" ]
then
rm /usr/local/sbin/pine64-config.sh
fi
chmod a+x pine64-config.sh
cp pine64-config.sh /usr/local/sbin
printf "\nInstallation finished. You can now execute the configuration tool with: \n \n 'sudo pine64-config.sh'\n \n"
rm pine64-config.sh