Skip to content

Commit

Permalink
start with Parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberAndi committed Sep 4, 2023
1 parent 1f94458 commit fad0cb1
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions openWRT_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ actEth=$(ifconfig | grep '^e\w*' -m 1 | cut -f1 -d ' ')
actWlan=$(ifconfig | grep '^w\w*' -m 1 | cut -f1 -d ' ')

#Internet Gateway
INET_GW=$(ip route | grep default | cut -f3 -d ' ')
if [ "$1" != "" ] then
INET_GW=$1
else
INET_GW=$(ip route | grep default | cut -f3 -d ' ')
fi
INET_GW_org=$INET_GW

read -p 'Please give me the WAN-IP (Gateway/Router): ['$INET_GW'] ' INET_GW
Expand Down Expand Up @@ -133,7 +137,11 @@ all_IP6="[::]"
ACCESS_SERVER=$(echo $($(echo ip addr show dev $(echo $actEth | cut -f1 -d' ')) | grep inet | cut -f6 -d ' ' ) | cut -f1 -d ' ' )

#Lokal LAN
LAN=$(echo $($(echo ip addr show dev $(echo $actEth | cut -f1 -d' ')) | grep inet | cut -f6 -d ' ' ) | cut -f1 -d ' ' | cut -f1 -d'/' )
if [ "$2" != "" ] then
LAN=$2
else
LAN=$(echo $($(echo ip addr show dev $(echo $actEth | cut -f1 -d' ')) | grep inet | cut -f6 -d ' ' ) | cut -f1 -d ' ' | cut -f1 -d'/' )
fi

if [ "$LAN" = "" ]
then
Expand All @@ -148,15 +156,23 @@ if [ "$LAN" = "" ]
LAN=$LAN_org
fi

LOCAL_DOMAIN='CyberSecBox.local'
if [ "$3" != "" ] then
LOCAL_DOMAIN_org=$3
else
LOCAL_DOMAIN_org='CyberSecBox.local'
fi
echo
read -p 'Your local Domain of your LAN? [CyberSecBox.local] ' LOCAL_DOMAIN
if [ "$LOCAL_DOMAIN" = "" ]
then
LOCAL_DOMAIN='CyberSecBox.local'
LOCAL_DOMAIN=$LOCAL_DOMAIN_org
fi

WIFI_SSID='CyberSecBox'
if [ "$4" != "" ] then
WIFI_SSID=$4
else
WIFI_SSID='CyberSecBox'
fi
WIFI_SSID_org=$WIFI_SSID
echo
read -p 'The Main-WiFi-SSID? ['$(echo $WIFI_SSID)'] ' WIFI_SSID
Expand All @@ -165,8 +181,12 @@ if [ "$WIFI_SSID" = "" ]
WIFI_SSID=$WIFI_SSID_org
fi

if [ "$5" != "" ] then
WIFI_PASS=$5
else
WIFI_PASS='Cyber,Sec9ox'
fi

WIFI_PASS='Cyber,Sec9ox'
WIFI_PASS_org=$WIFI_PASS
echo
read -p 'And the WiFi-Key? [Cyber,Sec9ox] ' WIFI_PASS
Expand Down Expand Up @@ -216,8 +236,11 @@ if [ "$DNS_PORT" = "" ]
DNS_Relay_port='9053'
fi


SECURE_RULES='y'
if [ "$6" != "" ] then
SECURE_RULESW=$6
else
SECURE_RULES='y'
fi

echo
echo
Expand Down

0 comments on commit fad0cb1

Please sign in to comment.