-
Notifications
You must be signed in to change notification settings - Fork 4
/
PocketCHIP-Deployer.sh
82 lines (74 loc) · 2.35 KB
/
PocketCHIP-Deployer.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
# Display a colorful chip logo.
echo ""
tput setaf 1; echo " # # #"
tput setaf 1; echo " #########"
tput setaf 3; echo "### ###"
tput setaf 3; echo " # {#} #"
tput setaf 2; echo "### '\######"
tput setaf 2; echo " # #"
tput setaf 6; echo "### ###"
tput setaf 6; echo " ########"
tput setaf 5; echo " # # #"
tput setaf 5; echo -------------
sleep 5
echo ""
# Update sources.list with sed commands.
tput setaf 1; echo "Updating /etc/apt/sources.list"
echo ""
sleep 5
sed -e '/jessie-backports/s/^#*/#/g' -i /etc/apt/sources.list
sed -i 's/ftp.us/deb/' /etc/apt/sources.list
sed -i 's/opensource.nextthing.co/chip.rodeo/' /etc/apt/sources.list
echo "Done."
read -rsp $'Press any key to continue...\n' -n1 key
# Update preferences with sed commands.
echo ""
tput setaf 3; echo "Updating /etc/apt/preferences"
echo ""
sleep 5
sed -i 's/opensource.nextthing.co/chip.rodeo/' /etc/apt/preferences
echo "Done."
read -rsp $'Press any key to continue...\n' -n1 key
# Add a repo key, update APT package list, and then upgrade.
echo ""
tput setaf 2; echo "Updating APT package list and Upgrading"
echo ""
sleep 5
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50
apt update
apt -y upgrade
tput setaf 2; echo "Done."
read -rsp $'Press any key to continue...\n' -n1 key
# Delete Pico-8, download and install the lastest Pico-8 version, then delete the downloaded zip file.
echo ""
tput setaf 6; echo "Updating Pico-8"
echo ""
sleep 5
rm -rf /usr/lib/pico8
wget https://www.lexaloffle.com/dl/chip/pico-8_0.2.4_chip.zip
unzip pico-8_0.2.4_chip.zip -d /usr/lib
mv /usr/lib/pico-8 /usr/lib/pico8
rm pico-8_0.2.4_chip.zip
echo "Done."
read -rsp $'Press any key to continue...\n' -n1 key
# Install OpenSSH server.
echo ""
tput setaf 5; echo "Installing OpenSSH Server"
echo ""
sleep 5
apt -y install openssh-server
tput setaf 5; echo "Done."
read -rsp $'Press any key to continue...\n' -n1 key
# Start the SSH server.
echo ""
tput setaf 5; echo "Starting SSH Server"
echo ""
sleep 5
systemctl start ssh
echo "Done."
# Display CHIP's wireless network IP address.
tput setaf 7; echo ""
echo "Setup Complete! "
echo "CHIP's IP Address:"
ip -4 a show wlan0 | grep -Po 'inet \K[0-9.]*'