iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update timezone
[automated-distro-installer]
/
wrt-setup
diff --git
a/wrt-setup
b/wrt-setup
index e9d620efb2e800187f5a02aef36dbdf86c799a4f..96a25647ae7eaee8c64b611db7bcf9c1bdcbf684 100755
(executable)
--- a/
wrt-setup
+++ b/
wrt-setup
@@
-23,45
+23,41
@@
x="$(readlink -f "$BASH_SOURCE")"; cd ${x%/*}
usage() {
cat <<EOF
usage() {
cat <<EOF
-usage: ${0##*/} [-h|--help] [
-2|--dev2] [HOST/IP
]
+usage: ${0##*/} [-h|--help] [
HOST/IP] [wrt-setup-local_ARGS
]
setup my router in general: dhcp, dns, etc.
setup my router in general: dhcp, dns, etc.
-dev2 is for setting up a second device for testing etc.
+Default HOST is root@10.0.0.1
+
+Note, use -m "''" to send an empty mac arg. When we get a new enough
+bash, we can use ${@@Q} to properly pass an empty var.
+
EOF
EOF
+ wrt-setup-local -h
exit $1
}
h=root@10.0.0.1
exit $1
}
h=root@10.0.0.1
-temp=$(getopt -l help,dev2 h2 "$@") || usage 1
-eval set -- "$temp"
-while true; do
- case $1 in
- -2|--dev2) local_arg=-2; shift ;;
- -h|--help) usage ;;
- --) shift; break ;;
- *) echo "$0: Internal error! unexpected args: $*" ; exit 1 ;;
- esac
-done
+case $1 in
+ -h|--help) usage ;;
+ -*) : ;;
+ ?*) h="$1"; shift ;;
+esac
-if (( $# > 1 )); then
- usage 1
-fi
-
-if [[ $# == 1 ]]; then
- read h <<<"$@"
-fi
+echo "$0: host=$h"
cat ~/.ssh/home.pub | ssh $h dd of=/etc/dropbear/authorized_keys 2>/dev/null
cat ~/.ssh/home.pub | ssh $h dd of=/etc/dropbear/authorized_keys 2>/dev/null
-scp /a/bin/fai/wrt-setup-local /a/bin/cedit/cedit $h:/usr/bin
-#
build
for openwrt 18.06.2, r7676-cddd7b4c77
+scp /a/
work/libremanage/libremanage /a/
bin/fai/wrt-setup-local /a/bin/cedit/cedit $h:/usr/bin
+#
relay is built
for openwrt 18.06.2, r7676-cddd7b4c77
sudo scp /q/root/shadow/router \
/a/opt/openwrt/source/bin/packages/mips_24kc/mypackages/relay_1.0-1_mips_24kc.ipk $h:
ssh $h <<EOF
sudo scp /q/root/shadow/router \
/a/opt/openwrt/source/bin/packages/mips_24kc/mypackages/relay_1.0-1_mips_24kc.ipk $h:
ssh $h <<EOF
+set -x
if ! opkg list-installed|grep bash; then
opkg update
opkg install bash
fi
export HOME_DOMAIN=$HOME_DOMAIN
if ! opkg list-installed|grep bash; then
opkg update
opkg install bash
fi
export HOME_DOMAIN=$HOME_DOMAIN
-wrt-setup-local $local_arg
+export WIRELESSMAC=$WIRELESSMAC
+wrt-setup-local $@
EOF
EOF