Detecting systemctl

This commit is contained in:
Bob Mottram 2015-08-07 22:53:28 +01:00
parent d301ebf72b
commit 4cbb4f74d7
1 changed files with 21 additions and 12 deletions

View File

@ -101,19 +101,19 @@ function mesh_babel {
echo ' echo "Interface $IFACE was not found"' >> $babel_script echo ' echo "Interface $IFACE was not found"' >> $babel_script
echo ' ifconfig $IFACE down' >> $babel_script echo ' ifconfig $IFACE down' >> $babel_script
echo ' pkill babeld' >> $babel_script echo ' pkill babeld' >> $babel_script
echo ' if [ -f /etc/init.d/networking ]; then' >> $babel_script echo ' if [ -f /bin/systemctl ]; then' >> $batman_script
echo ' service networking restart' >> $babel_script echo ' systemctl restart networking' >> $batman_script
echo ' else' >> $babel_script echo ' else' >> $batman_script
echo ' systemctl restart networking' >> $babel_script echo ' service networking restart' >> $batman_script
echo ' fi' >> $babel_script echo ' fi' >> $batman_script
echo ' exit 1' >> $babel_script echo ' exit 1' >> $babel_script
echo 'fi' >> $babel_script echo 'fi' >> $babel_script
echo '' >> $babel_script echo '' >> $babel_script
echo 'if [ -f /etc/init.d/networking ]; then' >> $babel_script echo 'if [ -f /bin/systemctl ]; then' >> $batman_script
echo ' service networking stop' >> $babel_script echo ' systemctl stop networking' >> $batman_script
echo 'else' >> $babel_script echo 'else' >> $batman_script
echo ' systemctl stop networking' >> $babel_script echo ' service networking stop' >> $batman_script
echo 'fi' >> $babel_script echo 'fi' >> $batman_script
echo 'ifconfig $IFACE down' >> $babel_script echo 'ifconfig $IFACE down' >> $babel_script
echo -n 'iwconfig $IFACE mode ad-hoc channel ' >> $babel_script echo -n 'iwconfig $IFACE mode ad-hoc channel ' >> $babel_script
echo "$WIFI_CHANNEL essid \"$ESSID\"" >> $babel_script echo "$WIFI_CHANNEL essid \"$ESSID\"" >> $babel_script
@ -159,7 +159,12 @@ function mesh_batman {
echo ' return' >> $batman_script echo ' return' >> $batman_script
echo ' fi' >> $batman_script echo ' fi' >> $batman_script
echo ' echo "info: enabling batman-adv mesh network $ESSID on $IFACE"' >> $batman_script echo ' echo "info: enabling batman-adv mesh network $ESSID on $IFACE"' >> $batman_script
echo ' if [ -f /bin/systemctl ]; then' >> $batman_script
echo ' systemctl stop networking' >> $batman_script echo ' systemctl stop networking' >> $batman_script
echo ' else' >> $batman_script
echo ' service networking stop' >> $batman_script
echo ' fi' >> $batman_script
echo ' sleep 5' >> $batman_script echo ' sleep 5' >> $batman_script
echo '' >> $batman_script echo '' >> $batman_script
echo ' # Might have to re-enable wifi' >> $batman_script echo ' # Might have to re-enable wifi' >> $batman_script
@ -218,7 +223,11 @@ function mesh_batman {
echo ' ifconfig $IFACE down' >> $batman_script echo ' ifconfig $IFACE down' >> $batman_script
echo ' iwconfig $IFACE mode managed' >> $batman_script echo ' iwconfig $IFACE mode managed' >> $batman_script
echo '' >> $batman_script echo '' >> $batman_script
echo ' if [ -f /bin/systemctl ]; then' >> $batman_script
echo ' systemctl restart networking' >> $batman_script echo ' systemctl restart networking' >> $batman_script
echo ' else' >> $batman_script
echo ' service networking restart' >> $batman_script
echo ' fi' >> $batman_script
echo '}' >> $batman_script echo '}' >> $batman_script
echo '' >> $batman_script echo '' >> $batman_script
echo 'if [ ! $IFACE_EXISTS ]; then' >> $batman_script echo 'if [ ! $IFACE_EXISTS ]; then' >> $batman_script