1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-10-18 00:50:07 +00:00
webvirtcloud/install.sh

24 lines
No EOL
723 B
Bash

#!/bin/bash
# ensure running as root
if [ "$(id -u)" != "0" ]; then
#Debian doesnt have sudo if root has a password.
if ! hash sudo 2>/dev/null; then
exec su -c "$0" "$@"
else
exec sudo "$0" "$@"
fi
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "$SCRIPT_DIR/webvirtcloud.sh" ]; then
INSTALLER="$SCRIPT_DIR/webvirtcloud.sh"
elif [ -f "./webvirtcloud.sh" ]; then
INSTALLER="./webvirtcloud.sh"
else
INSTALLER="./webvirtcloud.sh"
wget -O "$INSTALLER" "${WEBVIRTCLOUD_SCRIPT_URL:-https://raw.githubusercontent.com/catborise/webvirtcloud/master/webvirtcloud.sh}"
fi
chmod 744 "$INSTALLER"
"$INSTALLER" "$@" 2>&1 | tee -a /var/log/webvirtcloud-install.log