init
This commit is contained in:
commit
1816522a71
11 changed files with 229 additions and 0 deletions
44
bin/sc-client
Executable file
44
bin/sc-client
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/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
|
Loading…
Add table
Add a link
Reference in a new issue