From 8cfd40fa3362b2d6c3f7be8a2c979e2e2749b9eb Mon Sep 17 00:00:00 2001 From: Franz Bethke <bethke@math.hu-berlin.de> Date: Tue, 3 Apr 2018 19:08:52 +0200 Subject: [PATCH] Update connect script --- connectAdHoc.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/connectAdHoc.sh b/connectAdHoc.sh index de2506ae..5bda6222 100755 --- a/connectAdHoc.sh +++ b/connectAdHoc.sh @@ -2,30 +2,36 @@ # Odriod 10.49.43.1 # -echo 'start' +if [ -z "$1" ] + then + echo Missing last digit of IP-Adress + exit 1 +fi -echo 'sudo service network-manager stop' +echo start + +echo sudo service network-manager stop sudo service network-manager stop sleep 0.5 -echo 'sudo ifconfig wlan0 down' +echo sudo ifconfig wlan0 down sudo ifconfig wlan0 down sleep 0.5 -echo 'sudo iw wlan0 set type ibss' +echo sudo iw wlan0 set type ibss sudo iw wlan0 set type ibss sleep 0.5 -echo 'sudo ifconfig wlan0 up' +echo sudo ifconfig wlan0 up sudo ifconfig wlan0 up sleep 0.5 -echo 'sudo iw wlan0 ibss join SPHAF 2432' +echo sudo iw wlan0 ibss join SPHAF 2432 sudo iw wlan0 ibss join SPHAF 2432 sleep 0.5 -echo 'sudo ifconfig wlan0 10.42.43.3' -sudo ifconfig wlan0 10.42.43.3 +echo sudo ifconfig wlan0 10.42.43.$1 +sudo ifconfig wlan0 10.42.43.$1 sleep 0.5 -echo 'done' +echo done -- GitLab