-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04_add-user.sh
executable file
·54 lines (45 loc) · 1.52 KB
/
04_add-user.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
#!/bin/bash
set +x # debug off
#set -x # debug on
KIOSK_USER=kiosk
# --------------------------------------------------------------------
echo ""
echo "Check for user and add if missing"
id ${KIOSK_USER} > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "User \"${KIOSK_USER}\" exists already. Skipping.."
else
echo "Create User \"${KIOSK_USER}\" now.."
sudo adduser \
--system \
--shell /bin/bash \
--gecos "User for kiosk" \
--group \
--disabled-password \
--home /home/kiosk \
kiosk
fi
# --------------------------------------------------------------------
DFILE="kiosk.sh"
echo ""
echo "Deploying ${DFILE} script to /home/${KIOSK_USER}"
sudo cp ${DFILE} /home/${KIOSK_USER}
sudo chown ${KIOSK_USER}:${KIOSK_USER} /home/${KIOSK_USER}/${DFILE}
sudo chmod a+x /home/${KIOSK_USER}/${DFILE}
# --------------------------------------------------------------------
DFILE="screen_on.sh"
echo ""
echo "Deploying ${DFILE} script to /home/${KIOSK_USER}"
sudo cp ${DFILE} /home/${KIOSK_USER}
sudo chown ${KIOSK_USER}:${KIOSK_USER} /home/${KIOSK_USER}/${DFILE}
sudo chmod a+x /home/${KIOSK_USER}/${DFILE}
# --------------------------------------------------------------------
DFILE="screen_off.sh"
echo ""
echo "Deploying ${DFILE} script to /home/${KIOSK_USER}"
sudo cp ${DFILE} /home/${KIOSK_USER}
sudo chown ${KIOSK_USER}:${KIOSK_USER} /home/${KIOSK_USER}/${DFILE}
sudo chmod a+x /home/${KIOSK_USER}/${DFILE}
# --------------------------------------------------------------------
echo ""
echo "done"