misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket
2019-09-24 15:54:41 +02:00
parent c794a02c6a
commit 5bac6ba5c0
3 changed files with 6 additions and 29 deletions

View File

@ -5,7 +5,7 @@
REQUIREMENTS=( wget gunzip git dd e2fsck resize2fs parted losetup qemu-system-x86_64 )
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
PWNI_NAME="alpha"
PWNI_NAME="pwnagotchi"
PWNI_OUTPUT="pwnagotchi.img"
PWNI_SIZE="4"
@ -96,7 +96,7 @@ function provision_raspbian() {
# configure pwnagotchi
echo -e "$PWNI_NAME" > /etc/hostname
sed -i "s@^127\.0\.0\.1 .*@127.0.0.1 localhost "$PWNI_NAME" "$PWNI_NAME".local@g" /etc/hosts
sed -i "s@alpha@$PWNI_NAME@g" /etc/motd
sed -i "s@pwnagotchi@$PWNI_NAME@g" /etc/motd
chmod +x /etc/rc.local
@ -157,7 +157,7 @@ function usage() {
usage: $0 [OPTIONS]
Options:
-n <name> # Name of the pwnagotchi (default: alpha)
-n <name> # Name of the pwnagotchi (default: pwnagotchi)
-o <file> # Name of the img-file (default: pwnagotchi.img)
-s <size> # Size which should be added to second partition (in Gigabyte) (default: 4)
-p # Only run provisioning (assumes the image is already mounted)

View File

@ -8,7 +8,7 @@ USB_IFACE_NET=10.0.0.0/24
UPSTREAM_IFACE=${2:-enxe4b97aa99867}
ip addr add $USB_IFACE_IP/24 dev $USB_IFACE
ifconfig $USB_IFACE up
ip link set $USB_IFACE up
iptables -A FORWARD -o $UPSTREAM_IFACE -i $USB_IFACE -s $USB_IFACE_NET -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT