Verwendung:
- entweder
bash config-gluon.sh NAME
- oder
bash config-gluon.sh manman-location manman-node
# usage: <name>
# or: <manman location> <manman node>
set -euo pipefail
TMP=$(mktemp)
run() {
echo "$(tput bold)[*] $*$(tput init)"
ssh "root@192.168.1.1" -oStrictHostKeyChecking=no "-oGlobalKnownHostsFile=$TMP" "-oUserKnownHostsFile=$TMP" "$@"
}
clean() {
rm "$TMP"
}
trap clean EXIT
run gluon-info
if [ $# -gt 1 ]; then
run manman-sync enable "$1" "$2"
run pretty-hostname "$1-$2"
else
run pretty-hostname "$1"
fi
run uci set gluon-setup-mode.@setup_mode[0].configured=1
run uci set gluon.core.reconfigure=1
run uci commit
run reboot