[spinymouse@archlinux src]$ cat adhoc
#!/bin/bash
####### this part should change or simply be removed depending on the network card
#recreates the ath0 interface in ad hoc mode
modprobe -r ath_pci
modprobe ath_pci autocreate=adhoc
wlanconfig ath0 destroy
wlanconfig ath create wlandev wifi0 wlanmode adhoc
#######
#starts the ad hoc server
ifconfig ath0 down
iwconfig ath0 mode ad-hoc
iwconfig ath0 channel 4
iwconfig ath0 essid 'mine'
ifconfig ath0 10.0.0.1 up
#forwards the ad hoc network to the router
iptables -A FORWARD -i ath0 -o eth0 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE
sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
********** [2] ****************************************
[root@archlinux src]# sudo newlan -n mynewprofile
This application was designed for ArchLinux, to run anyway add --force.
[root@archlinux src]# sudo newlan --force -n mynewprofile
WARNING: Application execution forced, use at own risk.
ArchLinux netcfg Easy Wireless LAN 1.0.0.8
Invalid argument, try 'newlan --help' for more information.
[root@archlinux src]# newlan --help
This application was designed for ArchLinux, to run anyway add --force.
[root@archlinux src]# newlan --force --help
WARNING: Application execution forced, use at own risk.
ArchLinux netcfg Easy Wireless LAN 1.0.0.8
Invalid argument, try 'newlan --help' for more information.