-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_smate.sh
104 lines (104 loc) · 2.59 KB
/
set_smate.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
#
#
###################### SET DESKTOP FOLDERS FOR INDI & KSTARS LOGS ############
# Make two soft links on the desktop to Logs folders
echo "create links to logs"
ln -s /home/stellarmate/.indi/logs /home/stellarmate/Desktop/indi_logs
ln -s /home/stellarmate/.local/share/kstars/logs /home/stellarmate/Desktop/kstars_logs
#
echo
#
#
############################ REMOVE NOT USED FOLDERS ########################
# I use 'rmdir' instead of 'rm -r' because if there is something inside it will fail
# remove subfolders first, then main folder
echo "remove .astropy folder"
TARGET=/home/stellarmate/.astropy
#
rmdir "$TARGET"/config
rmdir "$TARGET"
#
echo
#
echo "remove astropy link"
rm /home/stellarmate/.config/astropy || echo "astropy link cannot be removed"
#
echo
#
#
########################### CHANGE NAME OF MACHINE ###########################
# to master, slave o test:
# stellarmate@master
# sudo nano /etc/hosts
# - replace '127.0.1.1\traspberry' with '127.0.1.1\t<name>'
# sudo nano /etc/hostname
# - set <name>
#
if [ -z "$RPITYPE" ]
then
read -r -p "Raspberry name (default stellarmate) ? " input
input=${input:-"stellarmate"}
input=$(echo "$input" | tr '[:upper:]' '[:lower:]')
NAME=$input
else
NAME="$RPITYPE"
fi
#
echo "change raspi name to stellarmate@$NAME"
sudo sed -i 's/127.0.1.1\tstellarmate/127.0.1.1\t"$NAME"/' /etc/hosts
echo "$NAME" > /etc/hostname
#
echo
#
#
######################### DONT START KSTARS AT BOOT #########################
echo "Do not start KStars at boot"
TARGET="/home/stellarmate/.config/autostart/kstars.desktop"
text="NotShowIn=LXDE;"
#
echo $text >> $TARGET
#
echo
#
#
############################### COPY UDEV RULES ###############################
echo "Copying udev rules"
SOURCE="./data/udev_rules/"
TARGET="/lib/udev/rules.d"
#
cp -v "$SOURCE"/* "$TARGET"
#
echo
#
#
############################# COPY DEVICE CONFIG #############################
echo "Copying device INDI configurations"
SOURCE="./data/indi_config"
TARGET="/home/stellarmate/.indi"
#
cp -v "$SOURCE"/* "$TARGET"
#
echo
#
#
############################## COPY KSTARS FOVs ##############################
echo "Copying KStars FOV data"
SOURCE="./data/kstars_config"
TARGET="/home/stellarmate/.local/share/kstars"
#
cp -v "$SOURCE"/fov.dat "$TARGET"
#
echo
#
############################# COPY KSTARS CONFIG ##############################
echo "Copying KStars Configuration"
SOURCE="./data/kstars_config"
TARGET="/home/stellarmate/.config"
#
cp -v "$SOURCE"/kstarsrc "$TARGET"/kstarsrc
#
echo
#
#
############################## ###################################