21 lines
1.0 KiB
Bash
21 lines
1.0 KiB
Bash
#!/bin/ash
|
|
#Get Resources
|
|
CurrentVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
|
|
echo $CurrentVersion > /opt/transfer.sh/Version
|
|
curl -L --retry 7 --retry-delay 5 https://github.com/dutchcoders/transfer.sh/releases/download/"$CurrentVersion"/transfersh-"$CurrentVersion"-linux-amd64 -o /opt/transfer.sh/transfersh-linux-amd64 || exit 1
|
|
|
|
#Setup
|
|
addgroup transfersh
|
|
adduser -S -s /bin/ash -h /home/transfersh -D -G transfersh transfersh
|
|
mkdir -p /opt/transfer.sh/CustomTheme
|
|
#Install transfer.sh custom theme
|
|
git clone https://git.bprieshof.nl/DarkTheme/brammp_transfer.sh-web.git /opt/transfer.sh/CustomTheme
|
|
#Configure transfer.sh
|
|
mv /opt/Setup/Configs/transfersh.conf /opt/transfer.sh/transfersh.conf
|
|
mv /opt/Setup/Configs/transfersh.service /etc/init.d/transfersh
|
|
#Setting permissions
|
|
chmod +x /etc/init.d/transfersh
|
|
chmod +x /opt/transfer.sh/transfersh-linux-amd64
|
|
chown -R transfersh:transfersh /opt/transfer.sh
|
|
#Enable service
|
|
rc-update add transfersh |