updated launcher + autoupdate
This commit is contained in:
22
launcher.sh
22
launcher.sh
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
INSTALL_DIR="${HOME}/linusware"
|
||||
INSTALL_DIR="${LINUSWARE_DIR:-${HOME}/linusware}"
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
CYAN='\033[0;36m'
|
||||
@@ -40,6 +40,26 @@ run_updater() {
|
||||
read -rp "Press Enter to return to menu..." _
|
||||
}
|
||||
|
||||
auto_update() {
|
||||
[ -x "${INSTALL_DIR}/update.sh" ] && "${INSTALL_DIR}/update.sh"
|
||||
}
|
||||
|
||||
# --- startup ---
|
||||
auto_update
|
||||
|
||||
if [ $# -ge 1 ]; then
|
||||
arg="$1"
|
||||
for i in "${!edition_names[@]}"; do
|
||||
name_lc=$(echo "${edition_names[$i]}" | tr '[:upper:]' '[:lower:]')
|
||||
arg_lc=$(echo "$arg" | tr '[:upper:]' '[:lower:]')
|
||||
if [ "$arg_lc" = "$name_lc" ]; then
|
||||
exec "${editions[$i]}"
|
||||
fi
|
||||
done
|
||||
echo -e "${RED}Unknown edition: $arg${NC}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# whiptail TUI
|
||||
if command -v whiptail >/dev/null 2>&1; then
|
||||
while true; do
|
||||
|
||||
Reference in New Issue
Block a user