-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathpkg_direwolf
executable file
·180 lines (161 loc) · 6.32 KB
/
pkg_direwolf
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/bin/bash
###
### SIGPI
###
### pkg_direwolf
###
case "$1" in
remove )
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ## Remove DireWolf"
echo -e "${SIGPI_BANNER_RESET}"
cd $SIGPI_SOURCE/direwolf/build
sudo make uninstall
cd $SIGPI_SOURCE
rm -rf $SIGPI_SOURCE/DireWolf
sed -i /direwolf/d $SIGPI_INSTALLED
### Remove Menu icon
sudo rm $DESKTOP_ICONS/direwolf.png
### Remove Desktop links
sudo rm $DESKTOP_FILES/direwolf.desktop
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ## DireWolf Removed"
echo -e "${SIGPI_BANNER_RESET}"
;;
purge )
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ## Purge DireWolf"
echo -e "${SIGPI_BANNER_RESET}"
cd $SIGPI_SOURCE/direwolf/build
sudo make uninstall
cd $SIGPI_SOURCE
rm -rf $SIGPI_SOURCE/DireWolf
sed -i /direwolf/d $SIGPI_INSTALLED
sudo rm /usr/local/share/doc/direwolf/scripts/dw-start.sh
sudo rm /usr/local/bin/run_direwolf.sh
sudo rm -rf /usr/local/share/doc/direwolf/conf/*
sudo rm -rf /usr/local/etc/direwolf
### Remove Menu icon
sudo rm $DESKTOP_ICONS/direwolf.png
### Remove Desktop links
sudo rm $DESKTOP_FILES/direwolf.desktop
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ## DireWolf Purged"
echo -e "${SIGPI_BANNER_RESET}"
;;
install )
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ##"
echo -e "${SIGPI_BANNER_COLOR} ## Install DireWolf (AFSK APRS)"
echo -e "${SIGPI_BANNER_COLOR} ##"
echo -e "${SIGPI_BANNER_RESET}"
## DEPENDENCIES
sudo apt-get install -y libasound2-dev
sudo apt-get install -y libudev-dev
sudo apt-get install -y libgps-dev
sudo apt-get install -y libhamlib-dev
## PACKAGE
cd $SIGPI_SOURCE
git clone https://www.github.com/wb2osz/direwolf.git
cd direwolf
mkdir build && cd build
cmake .. -Wno-dev
make -j4
sudo make install
sudo cp /usr/local/share/doc/direwolf/scripts/dw-start.sh /usr/local/bin/run_direwolf
sudo mkdir /usr/local/etc/direwolf
sudo cp /usr/local/share/doc/direwolf/conf/* /usr/local/etc/direwolf
cat $SIGPI_PKGLIST|grep "direwolf" >> $SIGPI_INSTALLED
## DESKTOP
# Add Menu icon
# Add Desktop links
sudo cp $SIGPI_SOURCE/direwolf/build/direwolf.desktop $DESKTOP_FILES/direwolf.desktop
# Change Category
sudo sed -i "s/Categories.*/Categories=$SIGPI_MENU_CATEGORY;/" $DESKTOP_FILES/direwolf.desktop
# Add to Menu
xdg-desktop-menu install --novendor --noupdate $DESKTOP_DIRECTORY/SIGpi.directory $DESKTOP_FILES/direwolf.desktop
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ## DireWolf Installed"
echo -e "${SIGPI_BANNER_RESET}"
;;
package )
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ##"
echo -e "${SIGPI_BANNER_COLOR} ## Package DireWolf (AFSK APRS)"
echo -e "${SIGPI_BANNER_COLOR} ##"
echo -e "${SIGPI_BANNER_RESET}"
## DEPENDENCIES
sudo apt-get install -y libasound2-dev
sudo apt-get install -y libudev-dev
sudo apt-get install -y libgps-dev
sudo apt-get install -y libhamlib-dev
## PACKAGE
cd $SIGPI_SOURCE
git clone https://www.github.com/wb2osz/direwolf.git
cd direwolf
mkdir build && cd build
cmake .. -Wno-dev
make -j4
sudo checkinstall --install=no
sudo mv *.deb $SIGPI_DEBS
## DESKTOP
# Add Icon
# Add Desktop
# Change Category
# Add to Menu
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ## DireWolf package built. Debian package available in $SIG_DEBS"
echo -e "${SIGPI_BANNER_RESET}"
;;
install )
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ##"
echo -e "${SIGPI_BANNER_COLOR} ## Build DireWolf (AFSK APRS)"
echo -e "${SIGPI_BANNER_COLOR} ##"
echo -e "${SIGPI_BANNER_RESET}"
## DEPENDENCIES
sudo apt-get install -y libasound2-dev
sudo apt-get install -y libudev-dev
sudo apt-get install -y libgps-dev
sudo apt-get install -y libhamlib-dev
## PACKAGE
cd $SIGPI_SOURCE
git clone https://www.github.com/wb2osz/direwolf.git
cd direwolf
mkdir build && cd build
cmake .. -Wno-dev
make -j4
sudo checkinstall
sudo mv *.deb $SIGPI_DEBS
sudo cp /usr/local/share/doc/direwolf/scripts/dw-start.sh /usr/local/bin/run_direwolf
sudo mkdir /usr/local/etc/direwolf
sudo cp /usr/local/share/doc/direwolf/conf/* /usr/local/etc/direwolf
cat $SIGPI_PKGLIST|grep "direwolf" >> $SIGPI_INSTALLED
## DESKTOP
# Add Menu icon
# Add Desktop links
sudo cp $SIGPI_SOURCE/direwolf/build/direwolf.desktop $DESKTOP_FILES/direwolf.desktop
# Change Category
sudo sed -i "s/Categories.*/Categories=$SIGPI_MENU_CATEGORY;/" $DESKTOP_FILES/direwolf.desktop
# Add to Menu
xdg-desktop-menu install --novendor --noupdate $DESKTOP_DIRECTORY/SIGpi.directory $DESKTOP_FILES/direwolf.desktop
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ## DireWolf built and installed"
echo -e "${SIGPI_BANNER_RESET}"
;;
config )
if [ !${2} ]; then
echo "missing callsign"
exit 0
fi
echo "ax0 ${3} 1200 255 7 APRRS/Packet" | sudo tee -a /etc/ax25/axports
sed -i "s/N0CALL/${3}/" "$SIGPI_ETC/direwolf.conf"
sed -i "s/# ADEVICE plughw:1,0/ADEVICE plughw:2,0/" $SIGPI_ETC/direwolf.conf
sed -i "/#PTT\ \/dev\/ttyUSB0\ RTS/a #Uncomment line below for PTT with sabrent sound card\n#PTT RIG 2 localhost:4532" $SIGPI_ETC/direwolf.conf
;;
* )
echo -e "${SIGPI_BANNER_COLOR}"
echo -e "${SIGPI_BANNER_COLOR} ## ERROR: Unkown action or package"
echo -e "${SIGPI_BANNER_RESET}"
;;
esac