sconnect/bin/sc-client

45 lines
689 B
Text
Raw Normal View History

2024-06-02 22:13:33 +02:00
#!/bin/sh
SC_COMMAND="$0 $@"
SC_SRC=${SC_SRC:-/opt/sconnect}
. $SC_SRC/lib/setup-env
show_welcome_header
[ $# -lt 1 ] && fatal_log "usage: $0 <command>"
command=$1
shift
case $command in
update)
LOGI attempting to update system...
escalate lib pm upgrade_packages
;;
run)
if [ -z "$@" ]; then
if command -v zsh >/dev/null; then
zsh
elif command -v bash >/dev/null; then
bash
else
sh
fi
else
$@
fi
;;
lib)
[ $# -lt 2 ] && fatal_log "usage: $0 lib <library> <command>"
. $SC_LIB/$1
shift
$@
;;
check)
exit 0
;;
*)
fatal_log "invalid command"
;;
esac