11
0

Move to Drone
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2022-06-28 18:31:12 +03:00
parent 1261a0ae05
commit ab5ad51ef9
8 changed files with 123 additions and 141 deletions

32
overlay/etc/profile Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/sh
[ -f /etc/banner ] && cat /etc/banner
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
export PATH=/usr/bin:/usr/sbin:/bin:/sbin
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
export HOME=${HOME:-/root}
export PS1='\u@\h:\w\$ '
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
[ -x /bin/more ] || alias more=less
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
HOSTNAME=$(uci get system.@system[0].hostname)
DOMAIN=$(uci -q get dhcp.@dnsmasq[0].domain)
if [ $? -eq 0 ]; then
FQDN=$HOSTNAME.$DOMAIN
else
FQDN=$HOSTNAME
fi
export PS1='\[\033[01;31m\]$FQDN\[\033[01;34m\] \W #\[\033[00m\] '
case "$TERM" in
xterm*|rxvt*)
echo -ne "\033]0;${USER}@${FQDN}:${PWD}\007"
;;
*)
;;
esac

View File

@@ -0,0 +1,3 @@
HOSTNAME=cam-$(cat /sys/class/net/eth0/address | cut -d : -f 4- | sed -e 's/://g')
uci set system.@system[0].hostname=$HOSTNAME
uci set network.lan.hostname=$HOSTNAME

View File

@@ -0,0 +1,14 @@
# Disable DHCP servers
/etc/init.d/odhcpd disable
/etc/init.d/dnsmasq disable
# Remove firewall rules since AP bridges ethernet to wireless anyway
uci delete firewall.@zone[1]
uci delete firewall.@zone[0]
uci delete firewall.@forwarding[0]
for j in $(seq 0 10); do uci delete firewall.@rule[0]; done
# Remove LAN interface
uci delete network.lan
uci delete network.globals.ula_prefix
uci delete dhcp.@dnsmasq[0].domain

View File

@@ -0,0 +1,5 @@
uci set mjpg-streamer.core.enabled='1'
uci set mjpg-streamer.core.resolution='1280x720'
uci set mjpg-streamer.core.fps='5'
uci set mjpg-streamer.core.username=user
uci set mjpg-streamer.core.password=XlwgWa3orRCpjbQAMaxh

View File

@@ -0,0 +1,10 @@
# Add Lauri's keys
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCWiKkJw8QKNFlCN5OF/bJSGIt8ZrTF5LOC/Cw6pqx76wdKzY5D/LTEXhHTY846oL8ep3p5OiuTUieOVqyyBTvy+ZNzj98WoJchH/adu07t8lj1755R1sBeZyha+5z+unKEexmYpCAcXfZLoRg4mQ6OnG6tD2itZZ+12igqVaMMUdR9dSAULsd60twmGYtEe5O1Y33YIXpyWttVySY4oSQZtItwaztUOlnxJS8JpECz324FqznrRNEq3M4EG8jf5PPkoCoTsinOLfeqUcXDhgVr+C5Rxgrv2uKXzprnEIY3fLsTf7J0hZyMiy78+ii1FtehkOmpMRNqtP4WDsTd0kEY5HdK3RMWqBSvH4NJA8SIRxV587w68bF4oe040am3YySborEBNRHZLDWOowAuPfE8aBLwHWcANox0bgVW+j6XugHPCnm6TM15iphgNJ7GVlVE8hWO1lN4FTYe6vhtY54/oSM8qR87437lBwhUwVE3du6A3N68PL8QiZcKYBIB33U= lauri@lauri-x230
' > /etc/dropbear/authorized_keys
# Ping lauri for plaintext password, eg when there's issue camera
sed -i 's|^root::|root:$1$Ji4oV3An$2h4IhUFWhheefdaWEW.vg/:|' /etc/shadow
# Move Dropbear to port 2222
uci set dropbear.@dropbear[0].Port=2222