Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.

Commit b37df95

Browse files
committed
Change install path
1 parent 6e5e656 commit b37df95

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ open terminal and run
1818

1919
After running the installer, you may either start from the "Application Menu", or run by command `ipgw`. <br>
2020
Use `ipgw --help` to get more information of usage. <br>
21+
22+
**For version v2.2 and later**
23+
24+
The program will be installed to `/opt/2645/neuipgw/` <br>
25+
You may change the configuration of the installed program by editing `/etc/neuipgw/user.cfg`
26+
27+
**For version v2.1 and before**
28+
2129
The program will be installed to `/usr/local/neuipgw/` <br>
22-
You may change the configuration of the installed program by editing `/usr/local/neuipgw/user.cfg`
30+
The configuration file will be stored at `/usr/local/neuipgw/user.cfg`
2331

2432
**If you prefer not to install it,**
2533

install.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,24 @@ read repassword
2626
done
2727
stty echo
2828

29-
mkdir /usr/local/neuipgw
30-
cp ./ipgw.sh /usr/local/neuipgw/ipgw
31-
chmod 755 /usr/local/neuipgw/ipgw
29+
mkdir /opt/2645
30+
mkdir /opt/2645/neuipgw
31+
mkdir /etc/neuipgw
32+
cp ./ipgw.sh /opt/2645/neuipgw/ipgw
33+
chmod 755 /opt/2645/neuipgw/ipgw
3234
#cp ./user.cfg /usr/local/neuipgw/user.cfg
33-
echo "#!/bin/bash" > /usr/local/neuipgw/user.cfg
34-
echo "USER_NAME=$username" >> /usr/local/neuipgw/user.cfg
35-
echo "USER_PASS=$password" >> /usr/local/neuipgw/user.cfg
36-
cp ./ipgw.png /usr/local/neuipgw/ipgw.png
35+
echo "#!/bin/bash" > /etc/neuipgw/user.cfg
36+
echo "USER_NAME=$username" >> /etc/neuipgw/user.cfg
37+
echo "USER_PASS=$password" >> /etc/neuipgw/user.cfg
38+
cp ./ipgw.png /opt/2645/neuipgw/ipgw.png
3739
rm -f /usr/bin/ipgw
38-
ln -s /usr/local/neuipgw/ipgw /usr/bin/ipgw
40+
ln -s /opt/2645/neuipgw/ipgw /usr/bin/ipgw
3941

4042
echo [Desktop Entry]>/usr/share/applications/neuipgw.desktop
4143
echo Name=NEU-IPGW>>/usr/share/applications/neuipgw.desktop
4244
echo Comment=Speedier Internet Access>>/usr/share/applications/neuipgw.desktop
4345
echo Exec=/usr/bin/ipgw>>/usr/share/applications/neuipgw.desktop
44-
echo Icon=/usr/local/neuipgw/ipgw.png>>/usr/share/applications/neuipgw.desktop
46+
echo Icon=/opt/2645/neuipgw/ipgw.png>>/usr/share/applications/neuipgw.desktop
4547
echo Terminal=true>>/usr/share/applications/neuipgw.desktop
4648
echo Type=Application>>/usr/share/applications/neuipgw.desktop
4749
echo Categories=Network>>/usr/share/applications/neuipgw.desktop

ipgw.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a syml
119119
done
120120
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
121121

122-
source $DIR/user.cfg
122+
if [ -f "$DIR/user.cfg" ]; then
123+
source $DIR/user.cfg
124+
else
125+
source /etc/neuipgw/user.cfg
126+
fi
123127

124128
temp=$(getopt -q -o qcdfmu:p:h --long connect,disconnect,force,mobile,query,username:,password:,help -- "$@")
125129
if [ $? != 0 ]

0 commit comments

Comments
 (0)