Skip to content

Commit

Permalink
Script and permissions fix
Browse files Browse the repository at this point in the history
Daioul (v2.92-12) to Safihre (v2.93-13) update fix
  • Loading branch information
mrjackyliang committed Mar 3, 2018
1 parent 3e0156d commit b7e4c79
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ These are the descriptions of the variables that may be changed depending on you
1. __TRANS_USER__ - The user running under Transmission (default is __transmission__)
2. __TRANS_GROUP__ - The group of Transmission's user (default is __users__)
3. __TRANS_VAR__ - Path where the settings.json file is located (full path, no ending backslash)
4. __TRANS_SSSS__ - Path where the Transmission start-stop-status file is located (full path)

## Get Synology Configuration ID
To retrieve the __VPN_CONFID__, follow these steps:
Expand Down Expand Up @@ -80,3 +79,11 @@ If this script took Transmission offline (cannot download), follow the instructi
5. Click __OK__ then __Apply__.

NOTE: Once this setting is enabled, you do not need to re-run the script. The internet for Transmission will start working immediately.

## Maintainer Change Fix
In light of the recent update from Daioul (v2.92-12) to Safihre (v2.93-13), it broke the start and stop Transmission script, and changed the default user and groups. If you are using Safihre's version, here are the changes needed to be made:

- The default variable of __TRANS_USER__ is "svc-transmission"
- The default variable of __TRANS_GROUP__ is "root"

NOTE: This script has replaced the start-stop-status script with synopkg (Synology Package Center Command Line).
27 changes: 13 additions & 14 deletions transmissionVPN/transmissionvpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ IP_CHECK=http://ipinfo.io/ip
TRANS_USER=transmission
TRANS_GROUP=users
TRANS_VAR=/volume1/@appstore/transmission/var
TRANS_SSSS=/var/packages/transmission/scripts/start-stop-status

# Script Starts
case "$1" in
Expand Down Expand Up @@ -54,7 +53,7 @@ start)
echo "VPN Address is "$VPN_ADDR

# Stops Transmission
$TRANS_SSSS stop
synopkg stop transmission

# Binds IPv4 VPN Address to interface
echo "Binding IPv4 VPN Address ..."
Expand All @@ -64,7 +63,7 @@ start)
mv $TRANS_VAR/settings.json.bak $TRANS_VAR/settings.json

# Starts Transmission
$TRANS_SSSS start
synopkg start transmission

else

Expand All @@ -80,7 +79,7 @@ stop)
if echo `ifconfig` | grep -q "$VPN_TYPE"; then

# Stops Transmission
$TRANS_SSSS stop
synopkg stop transmission

# Binds IPv4 Home Address to interface
echo "Binding IPv4 Home Address ..."
Expand All @@ -90,7 +89,7 @@ stop)
mv $TRANS_VAR/settings.json.bak $TRANS_VAR/settings.json

# Starts Transmission
$TRANS_SSSS start
synopkg start transmission

# Show Message
echo "VPN is disconnecting ..."
Expand Down Expand Up @@ -131,7 +130,7 @@ repair)

# Display both IP addresses
echo "Interface IP is "$VPN_ADDR
echo "ipinfo.io IP is "$VPN_RESP
echo "API Query IP is "$VPN_RESP
echo "Network Port is "$VPN_PORT

# If IP Address does not match or port is closed
Expand All @@ -141,7 +140,7 @@ repair)
echo "VPN is not working ..."

# Stops Transmission
$TRANS_SSSS stop
synopkg stop transmission

# Binds IPv4 Home Address to interface
echo "Binding IPv4 Home Address ..."
Expand Down Expand Up @@ -176,7 +175,7 @@ repair)

# Display both IP addresses
echo "Interface IP is "$VPN_ADDR
echo "ipinfo.io IP is "$VPN_RESP
echo "API Query IP is "$VPN_RESP

# Checks VPN connection
if [ "$VPN_ADDR" != "$VPN_RESP" ]; then
Expand All @@ -199,7 +198,7 @@ repair)
fi

# Starts Transmission
$TRANS_SSSS start
synopkg start transmission

else

Expand All @@ -213,7 +212,7 @@ install)
echo "Installing ..."

# Stops Transmission
$TRANS_SSSS stop
synopkg stop transmission

# Binds IPv4 Home Address to interface
echo "Binding IPv4 Home Address ..."
Expand All @@ -223,7 +222,7 @@ install)
mv $TRANS_VAR/settings.json.bak $TRANS_VAR/settings.json

# Starts Transmission
$TRANS_SSSS start
synopkg start transmission

# Checks if VPN is connected
if echo `ifconfig` | grep -q "$VPN_TYPE"; then
Expand All @@ -241,7 +240,7 @@ uninstall)
echo "Uninstalling ..."

# Stops Transmission
$TRANS_SSSS stop
synopkg stop transmission

# Binds IPv4 Default Address to interface
echo "Binding IPv4 Default Address ..."
Expand All @@ -251,7 +250,7 @@ uninstall)
mv $TRANS_VAR/settings.json.bak $TRANS_VAR/settings.json

# Starts Transmission
$TRANS_SSSS start
synopkg start transmission

# Checks if VPN is connected
if echo `ifconfig` | grep -q "$VPN_TYPE"; then
Expand All @@ -271,4 +270,4 @@ uninstall)
;;
esac

exit 0
exit 0

0 comments on commit b7e4c79

Please sign in to comment.