Merge pull request #17 from caquino/caquino/powersave
services cleanup. powersave features and shellcheck fixes
This commit is contained in:
commit
9239490103
scripts
sdcard
@ -195,6 +195,9 @@ function provision_raspbian() {
|
|||||||
# slows down boot
|
# slows down boot
|
||||||
systemctl disable apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service
|
systemctl disable apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service
|
||||||
|
|
||||||
|
# unecessary services
|
||||||
|
systemctl disable triggerhappy bluetooth wpa_supplicant
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
sed -i'' 's/^#//g' etc/ld.so.preload
|
sed -i'' 's/^#//g' etc/ld.so.preload
|
||||||
cd "${REPO_DIR}"
|
cd "${REPO_DIR}"
|
||||||
@ -213,7 +216,7 @@ usage: $0 [OPTIONS]
|
|||||||
-i <file> # Provide the path of an already downloaded raspbian image
|
-i <file> # Provide the path of an already downloaded raspbian image
|
||||||
-o <file> # Name of the img-file (default: pwnagotchi.img)
|
-o <file> # Name of the img-file (default: pwnagotchi.img)
|
||||||
-s <size> # Size which should be added to second partition (in Gigabyte) (default: 4)
|
-s <size> # Size which should be added to second partition (in Gigabyte) (default: 4)
|
||||||
-v <version> # Version of raspbian (Supported: $SUPPORTED_RASPBIAN_VERSIONS; default: latest)
|
-v <version> # Version of raspbian (Supported: ${SUPPORTED_RASPBIAN_VERSIONS[*]}; default: latest)
|
||||||
-p # Only run provisioning (assumes the image is already mounted)
|
-p # Only run provisioning (assumes the image is already mounted)
|
||||||
-d # Only run dependencies checks
|
-d # Only run dependencies checks
|
||||||
-h # Show this help
|
-h # Show this help
|
||||||
|
@ -7,12 +7,12 @@ USB_IFACE_NET=10.0.0.0/24
|
|||||||
# host interface to use for upstream connection
|
# host interface to use for upstream connection
|
||||||
UPSTREAM_IFACE=${2:-enxe4b97aa99867}
|
UPSTREAM_IFACE=${2:-enxe4b97aa99867}
|
||||||
|
|
||||||
ip addr add $USB_IFACE_IP/24 dev $USB_IFACE
|
ip addr add "$USB_IFACE_IP/24" dev "$USB_IFACE"
|
||||||
ip link set $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 -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
|
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
||||||
iptables -t nat -F POSTROUTING
|
iptables -t nat -F POSTROUTING
|
||||||
iptables -t nat -A POSTROUTING -o $UPSTREAM_IFACE -j MASQUERADE
|
iptables -t nat -A POSTROUTING -o "$UPSTREAM_IFACE" -j MASQUERADE
|
||||||
|
|
||||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
@ -1195,3 +1195,8 @@ dtoverlay=dwc2
|
|||||||
dtparam=spi=on
|
dtparam=spi=on
|
||||||
dtoverlay=spi1-3cs
|
dtoverlay=spi1-3cs
|
||||||
|
|
||||||
|
# Disable bluetooth
|
||||||
|
dtoverlay=pi3-disable-bt
|
||||||
|
# Disable audio
|
||||||
|
dtparam=audio=off
|
||||||
|
|
||||||
|
@ -10,5 +10,7 @@
|
|||||||
# bits.
|
# bits.
|
||||||
#
|
#
|
||||||
# By default this script does nothing.
|
# By default this script does nothing.
|
||||||
|
# Powersave (Disable HDMI) ~30ma
|
||||||
|
/opt/vc/bin/tvservice -o
|
||||||
/root/pwnagotchi/scripts/startup.sh &
|
/root/pwnagotchi/scripts/startup.sh &
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -5,6 +5,7 @@ defscrollback 1024
|
|||||||
startup_message off
|
startup_message off
|
||||||
altscreen on
|
altscreen on
|
||||||
autodetach on
|
autodetach on
|
||||||
|
zombie kr
|
||||||
|
|
||||||
activity "activity in %n (%t)"
|
activity "activity in %n (%t)"
|
||||||
bell_msg "bell in %n (%t)"
|
bell_msg "bell in %n (%t)"
|
||||||
|
@ -5,6 +5,7 @@ defscrollback 1024
|
|||||||
startup_message off
|
startup_message off
|
||||||
altscreen on
|
altscreen on
|
||||||
autodetach on
|
autodetach on
|
||||||
|
zombie kr
|
||||||
|
|
||||||
activity "activity in %n (%t)"
|
activity "activity in %n (%t)"
|
||||||
bell_msg "bell in %n (%t)"
|
bell_msg "bell in %n (%t)"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
for i in `seq 1 $1`;
|
for i in $(seq 1 "$1");
|
||||||
do
|
do
|
||||||
echo 0 >/sys/class/leds/led0/brightness
|
echo 0 >/sys/class/leds/led0/brightness
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
@ -10,3 +10,8 @@ done
|
|||||||
|
|
||||||
echo 0 >/sys/class/leds/led0/brightness
|
echo 0 >/sys/class/leds/led0/brightness
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
|
|
||||||
|
# Powersave options
|
||||||
|
# Disable power LED ~30ma
|
||||||
|
echo none >/sys/class/leds/led0/trigger
|
||||||
|
echo 1 >/sys/class/leds/led0/brightness
|
||||||
|
Loading…
x
Reference in New Issue
Block a user