Skip to content

Commit

Permalink
Merge pull request NIT-Hamirpur-NITH#27 from clearnote01/master
Browse files Browse the repository at this point in the history
npm support; minor bug fix
  • Loading branch information
Akarshit authored Aug 16, 2016
2 parents e0e999e + 2f21347 commit 99ab40a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Also, ProxyHelper keeps your tor alive! No more **Tor has been disconnected!** m

```
git clone https://github.com/Nithmr/ProxyHelper.git ~/.proxyhelper && cd ~/.proxyhelper &&
sudo chmod +x ./install.sh && ./install.sh
chmod +x ./install.sh && ./install.sh
```

Note: You may need to set proxy in git before using this.
Expand Down
15 changes: 8 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@ then
exit
fi

sudo chmod +x $home/.proxyhelper/zetproxy
sudo chmod +x $home/.proxyhelper/proxyhelper.py
sudo chmod +x $home/.proxyhelper/torpinger
chmod +x $home/.proxyhelper/zetproxy
chmod +x $home/.proxyhelper/proxyhelper.py
chmod +x $home/.proxyhelper/torpinger
#chmod +x ./auto-update.sh
sudo chmod +x $home/.proxyhelper/uninstall.sh
chmod +x $home/.proxyhelper/uninstall.sh

# Remove earlier installations if they exist
# Needs for people with earlier version of PH
# Which might clash
if [ -x "$(command -v phelp)" ]
if [ -x "$(command -v /usr/bin/phelp)" ]
then
sudo rm /usr/bin/phelp
fi
if [ -x "$(command -v zetproxy)" ]
if [ -x "$(command -v /usr/bin/zetproxy)" ]
then
sudo rm /usr/bin/zetproxy
fi
if [ -x "$(command -v torpinger)" ]
if [ -x "$(command -v /usr/bin/torpinger)" ]
then
sudo rm /usr/bin/torpinger
fi
Expand Down
18 changes: 18 additions & 0 deletions zetproxy
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ proxy_git()
echo ' -> Proxy set in git'
}

#proxy for npm
proxy_npm()
{ echo '## Setting npm proxy'

if [[ $WIFI_PROXY = "None" ]]
then
npm config delete https-proxy
npm config delete proxy
else
npm config set https-proxy "http://$WIFI_PROXY:$PORT/"
npm config set proxy "http://$WIFI_PROXY:$PORT/"
fi
echo ' -> Proxy set in npm'
}
# proxy for kde 5.5
proxy_kde()
{
Expand Down Expand Up @@ -188,6 +202,10 @@ if [ -x "$(command -v git)" ]
then
proxy_git
fi
if [ -x "$(command -v npm)" ]
then
proxy_npm
fi
if [ -x "$(command -v apt)" ]
then
proxy_apt
Expand Down

0 comments on commit 99ab40a

Please sign in to comment.