toolbox/etc/runit/1

21 lines
531 B
Plaintext
Raw Normal View History

2023-12-20 13:04:23 -07:00
#! /bin/sh
error () {
printf '\033[31mFLAGRANT SYSTEM ERROR\033[0m - %s' "$*" >> /etc/motd
}
echo "*** Setting up directories"
[ -d /mnt/toolbox ] && mkdir -p /mnt/toolbox/lbu /mnt/toolbox/apk
[ -d /etc/apk/cache ] || ln -s /mnt/toolbox/apk /etc/apk/cache
echo "*** Restoring system from backup"
apkovl=/mnt/toolbox/lbu/$(hostname).apkovl.tar.gz
if [ -f $apkovl ]; then
tar xf $apkovl || error "restoring system: untar $apkovl failed"
else
echo "$apkovl missing, skipping restore"
fi
echo "*** Updating packages"
apk fix