diff --git a/connectAdHoc.sh b/connectAdHoc.sh
index de2506ae85eb766a87c668ce52a4aad8ca16b584..5bda622230c1685a2c0f0b2ea55be866a15e60ff 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