@@ -51,43 +51,52 @@ set -e
51
51
WEBIDE_ROOT=" /usr/share/adafruit/webide"
52
52
53
53
# needed for SSH key and config access at this point.
54
- # WEBIDE_HOME="/home/webide"
54
+ WEBIDE_HOME=" /home/webide"
55
55
56
56
mkdir -p " $WEBIDE_ROOT "
57
- # mkdir -p "$WEBIDE_HOME"
58
- # cd "$WEBIDE_ROOT"
57
+ mkdir -p " $WEBIDE_HOME /tmp "
58
+ cd " $WEBIDE_ROOT "
59
59
60
60
echo " **** Downloading the latest version of the WebIDE ****"
61
61
curl -L https://adafruit-download.s3.amazonaws.com/webide-0.3.12.tar.gz | tar xzf -
62
62
63
63
echo " **** Installing required libraries ****"
64
64
echo " **** (redis-server git restartd libcap2-bin avahi-daemon i2c-tools python-smbus) ****"
65
65
apt-get update
66
- apt-get install nodejs-legacy git libcap2-bin i2c-tools python-smbus ntp -y
67
-
68
- # echo "**** Create webide user and group ****"
69
- # groupadd webide || true
70
- # useradd -g webide webide || true
71
- # usermod -a -G i2c,sudo webide || true
72
- #
73
- # echo "**** Adding webide user to sudoers ****"
74
- # if [ -f "/etc/sudoers.tmp" ]; then
75
- # rm /etc/sudoers.tmp
76
- # fi
77
- # cp /etc/sudoers /etc/sudoers.tmp
78
- # echo "webide ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.tmp
79
- # visudo -c -f /etc/sudoers.tmp
80
- # if [ "$?" -eq "0" ]; then
81
- # cp /etc/sudoers.tmp /etc/sudoers
82
- # fi
83
- # rm /etc/sudoers.tmp
84
- #
85
- # chown -R webide:webide "$WEBIDE_HOME"
86
- # chown -R webide:webide "$WEBIDE_ROOT"
87
- # chmod 775 "$WEBIDE_ROOT"
88
- #
89
- # echo "**** Adding default .bashrc file for webide user ****"
90
- # cp "$WEBIDE_ROOT/scripts/.bashrc" "$WEBIDE_HOME"
66
+ apt-get install nodejs-legacy npm git libcap2-bin i2c-tools python-smbus ntp libkrb5-dev -y
67
+
68
+ echo " **** Create webide user and group ****"
69
+ groupadd webide || true
70
+ useradd -g webide webide || true
71
+ usermod -a -G i2c,sudo webide || true
72
+ chsh -s /bin/bash webide
73
+
74
+ echo " **** Adding webide user to sudoers ****"
75
+ if [ -f " /etc/sudoers.tmp" ]; then
76
+ rm /etc/sudoers.tmp
77
+ fi
78
+ cp /etc/sudoers /etc/sudoers.tmp
79
+ echo " webide ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.tmp
80
+ visudo -c -f /etc/sudoers.tmp
81
+ if [ " $? " -eq " 0" ]; then
82
+ cp /etc/sudoers.tmp /etc/sudoers
83
+ fi
84
+ rm /etc/sudoers.tmp
85
+
86
+ echo " **** Installing webide dependencies ****"
87
+ npm config set tmp " $WEBIDE_HOME /tmp"
88
+ npm install
89
+
90
+ chown -R webide:webide " $WEBIDE_HOME "
91
+ chown -R webide:webide " $WEBIDE_ROOT "
92
+ chmod 775 " $WEBIDE_ROOT "
93
+
94
+ echo " **** Adding default .bashrc file for webide user ****"
95
+ cp " $WEBIDE_ROOT /scripts/.bashrc" " $WEBIDE_HOME "
96
+
97
+ echo " **** Installing webide dependencies ****"
98
+ npm install -g npm
99
+ npm install
91
100
92
101
echo " Attempting to force reload date and time from ntp server"
93
102
/etc/init.d/ntp force-reload
0 commit comments