Skip to content
Snippets Groups Projects
Select Git revision
  • 7153090961eca1f7dcaaa0f87e864432d879fbec
  • main default protected
2 results

entrypoint.sh

Blame
  • Dmitriy Safronov's avatar
    Dmitriy Safronov authored
    71530909
    History
    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"