Select Git revision
entrypoint.sh

Dmitriy Safronov authored
entrypoint.sh 512 B
#!/usr/bin/env sh
die() {
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e '\[ '"${RED}$1${NC}"' ]/'
exit 1
}
rsync -a /opt/ /home/openwrt/.ssh/ || die "Couldn't rsync user ssh settings"
chown -R openwrt:openwrt /home/openwrt/.ssh || die "Couldn't change ownership for user ssh settings"
chmod -R a-rwx,u+rwX /home/openwrt/.ssh || die "Couldn't change access rights for user ssh settings"
exec sudo -u openwrt -g openwrt -E -H sh -c 'exec sh /sync.sh' || die "Couldn't run sync sript as user"