formatting
This commit is contained in:
parent
5ddf7aea9b
commit
375fa30d2e
@ -25,10 +25,10 @@ function update_script() {
|
|||||||
if [ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ] || [ ! -f /opt/${APP}_version.txt ]; then
|
if [ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ] || [ ! -f /opt/${APP}_version.txt ]; then
|
||||||
msg_info "Updating ${APP} LXC"
|
msg_info "Updating ${APP} LXC"
|
||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o $temp_file
|
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o "$temp_file"
|
||||||
$STD unzip -j -o $temp_file '*/**' -d /opt/rclone
|
$STD unzip -j -o "$temp_file" '*/**' -d /opt/rclone
|
||||||
rm -f $temp_file
|
rm -f "$temp_file"
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt
|
||||||
msg_ok "Updated Successfully"
|
msg_ok "Updated Successfully"
|
||||||
else
|
else
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
|
@ -23,18 +23,18 @@ msg_info "Installing rclone"
|
|||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
mkdir -p /opt/rclone
|
mkdir -p /opt/rclone
|
||||||
RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
RELEASE=$(curl -s https://api.github.com/repos/rclone/rclone/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o $temp_file
|
curl -fsSL "https://github.com/rclone/rclone/releases/download/v${RELEASE}/rclone-v${RELEASE}-linux-amd64.zip" -o "$temp_file"
|
||||||
$STD unzip -j $temp_file '*/**' -d /opt/rclone
|
$STD unzip -j "$temp_file" '*/**' -d /opt/rclone
|
||||||
cd /opt/rclone
|
cd /opt/rclone
|
||||||
PASSWORD=$(head -c 16 /dev/urandom | xxd -p -c 16)
|
PASSWORD=$(head -c 16 /dev/urandom | xxd -p -c 16)
|
||||||
$STD htpasswd -cb -B login.pwd admin $PASSWORD
|
$STD htpasswd -cb -B login.pwd admin "$PASSWORD"
|
||||||
{
|
{
|
||||||
echo "rclone-Credentials"
|
echo "rclone-Credentials"
|
||||||
echo "rclone User Name: admin"
|
echo "rclone User Name: admin"
|
||||||
echo "rclone Password: $PASSWORD"
|
echo "rclone Password: $PASSWORD"
|
||||||
} >>~/rclone.creds
|
} >>~/rclone.creds
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt
|
||||||
rm -f $temp_file
|
rm -f "$temp_file"
|
||||||
msg_ok "Installed rclone"
|
msg_ok "Installed rclone"
|
||||||
|
|
||||||
msg_info "Enabling rclone Service"
|
msg_info "Enabling rclone Service"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user