-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
executable file
·63 lines (56 loc) · 1.58 KB
/
setup
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
58
59
60
61
62
63
#!/bin/bash
USAGE="
$(basename "$0") [-h -p -v] -- set up Kiosk-Mode for Raspberry pi's
Options:
-h [or -?] shows this help text
-p sets the password for x11vnc
-v shows the installer's version
"
VERSION="1.1.0"
while getopts "h?p:s:v" options; do
case $options in
h|\? ) echo "$USAGE"
exit 0;;
p ) PASSWORD=$OPTARG;;
v ) echo $VERSION
exit 0;;
esac
done
if [ -n "$PASSWORD" ]
then
echo " "
echo "#----------------------#"
echo "# KIOSK-MODE INSTALLER #"
echo "#----------------------#"
echo " "
echo "updating package list"
apt-get update
echo " "
echo "removing unnecessary packages & cleaning up"
apt-get purge nodered minecraft-pi scratch wolfram-engine bluej greenfoot sonic-pi -y
apt-get autoclean
apt-get autoremove -y -q
echo " "
echo "upgrading and installing necessary packages"
apt-get upgrade -y
apt-get install vim unzip wpasupplicant x11vnc xscreensaver git iceweasel -y
echo " "
echo "copying files..."
cp ./files/kiosk-startup /usr/bin/kiosk-startup
chmod 755 /usr/bin/kiosk-startup
mkdir -p /home/pi/.config/autostart
cp ./files/autostart /home/pi/.config/lxsession/LXDE-pi/autostart
cp ./files/x11vnc.desktop /home/pi/.config/autostart/x11vnc.desktop
echo " "
echo "setting x11vnc password"
su -c "mkdir -p /home/pi/.vnc" pi
su -c "x11vnc -storepasswd $PASSWORD /home/pi/.vnc/passwd" pi
echo " "
echo "#-------------------#"
echo "# Install complete! #"
echo "#-------------------#"
echo " "
else
echo "Please specify a password for your x11vnc session."
exit 1
fi