Added CT's Duplicati and Vouch-Proxy
This commit is contained in:
21
CT-Files/vouchproxy/Scripts/AddOne.sh
Normal file
21
CT-Files/vouchproxy/Scripts/AddOne.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/ash
|
||||
|
||||
#Get and update ID
|
||||
if [ ! -f "/opt/VouchTemplates/.vouchID" ]; then ID=0; else source /opt/VouchTemplates/.vouchID; fi
|
||||
if [ -z ${ID+x} ]; then ID=0; fi
|
||||
ID=$(($ID+1))
|
||||
echo "ID=$ID" > /opt/VouchTemplates/.vouchID
|
||||
|
||||
#Settign up config
|
||||
mkdir "/etc/vouch-proxy$ID"
|
||||
cp -r /usr/share/webapps/vouch-proxy "/usr/share/webapps/vouch-proxy$ID"
|
||||
rm "/usr/share/webapps/vouch-proxy$ID/config"
|
||||
ln -s "/etc/vouch-proxy$ID" "/usr/share/webapps/vouch-proxy$ID/config"
|
||||
cp /opt/VouchTemplates/Vouch-Config "/etc/vouch-proxy$ID/config.yml"
|
||||
sed -i "s/VID/$ID/" "/etc/vouch-proxy$ID/config.yml"
|
||||
|
||||
#Setting up service
|
||||
cp /opt/VouchTemplates/Vouch-Service "/etc/init.d/vouch-proxy$ID"
|
||||
sed -i "s/VID/$ID/" "/etc/init.d/vouch-proxy$ID"
|
||||
chmod +x "/etc/init.d/vouch-proxy$ID"
|
||||
rc-update add "vouch-proxy$ID"
|
||||
Reference in New Issue
Block a user