Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit d25d6fd

Browse files
removed extra sudo's from firstboot script
1 parent 1abbe4f commit d25d6fd

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

raspberry-pi/gui.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_ip():
4040
ip_address = "Not Connected"
4141
finally:
4242
pi_socket.close()
43-
ip_address = "Local IP: " + ip_address
43+
ip_address = "Local Internet: " + ip_address
4444
return ip_address
4545

4646

@@ -52,9 +52,9 @@ def get_internet_status():
5252
"""
5353
response = os.system("ping -c 1 -w2 " + "8.8.8.8" + " > /dev/null 2>&1")
5454
if response == 0:
55-
internet_connection = "Internet: Connected"
55+
internet_connection = "Public Internet: Connected"
5656
else:
57-
internet_connection = "Internet: Disconnected"
57+
internet_connection = "Public Internet: Disconnected"
5858
return internet_connection
5959

6060

raspberry-pi/image-setup/firstboot.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
# gives a bit of time for the wifi to connect
44
sleep 20
55
# enable ssh
6-
sudo systemctl enable ssh
6+
systemctl enable ssh
77
# update and upgrade
8-
sudo apt-get update -y
9-
sudo apt-get upgrade -y
8+
apt-get update -y
9+
apt-get upgrade -y
1010
# install programs
11-
sudo apt-get install expect git zsh ufw python3-pip python3-venv -y
11+
apt-get install expect git zsh ufw python3-pip python3-venv -y
1212
# change default shell for root and pi users
13-
sudo chsh -s /bin/zsh pi
14-
sudo chsh -s /bin/zsh
13+
chsh -s /bin/zsh pi
14+
chsh -s /bin/zsh
1515
# install ohmyzsh for root and pi users
1616
sudo -u pi sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
17-
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
17+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
1818

1919

2020
# install drivers for adafruit screen
@@ -57,7 +57,7 @@ source /home/pi/controller_env/bin/activate
5757
pip3 install -r /home/pi/requirements.txt
5858
deactivate
5959
# make controller program executable
60-
sudo chmod +x /home/pi/controller.py
60+
chmod +x /home/pi/controller.py
6161
# add controller program to PATH
6262
echo "export PATH=\"/home/pi:$PATH\"" >>/home/pi/.zshrc
6363
# set so that the controller starts up when a user logs in a virtual environment
@@ -76,7 +76,7 @@ python3 -m venv /root/gui_env
7676
# download gui program from github
7777
wget -P /root https://raw.githubusercontent.com/himalayanelixir/arduino-pi-ceiling-sculpture/master/raspberry-pi/gui.py
7878
# make gui program executable
79-
sudo chmod +x /root/gui.py
79+
chmod +x /root/gui.py
8080
# add controller program to PATH
8181
echo "export PATH=\"/root:$PATH\"" >>/root/.zshrc
8282
# set so that the gui starts up on the adafruit screen when booted in a virtual environment
@@ -89,7 +89,7 @@ ufw default deny outgoing
8989
# allow local ssh
9090
ufw allow from 192.168.1.0/24 to any port 22
9191
# enable ufw, will auto start on boot
92-
echo "y" | sudo ufw enable
92+
echo "y" | ufw enable
9393

9494
# tell pi to restart after one minute. This is needed for the ssh changes to work and for the adafruit screen drivers
95-
sudo shutdown -r 1
95+
shutdown -r 1

0 commit comments

Comments
 (0)