balena-supervisor/scripts/init.sh

29 lines
808 B
Bash
Raw Normal View History

2013-07-17 13:03:05 +00:00
#!/bin/bash
2013-07-17 13:26:12 +00:00
REPO=ewa-client-bootstrap
# system upgrade
2013-07-17 13:03:05 +00:00
pacman --noconfirm --sync --refresh --sysupgrade --quiet
2013-07-17 13:26:12 +00:00
# user configuration
2013-07-17 13:03:05 +00:00
useradd -m -G users,wheel -s /bin/bash haki
2013-07-17 13:26:12 +00:00
# sudo configuration
2013-07-17 13:03:05 +00:00
pacman --noconfirm --sync --needed --quiet sudo
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers
2013-07-17 13:26:12 +00:00
#echo "Defaults env_keep+=SSH_AUTH_SOCK" >> /etc/sudoers
2013-07-17 13:03:05 +00:00
2013-07-17 13:26:12 +00:00
# dependencies
2013-07-17 13:03:05 +00:00
pacman --noconfirm --sync --needed --quiet git nodejs openvpn yaourt
yaourt --noconfirm --sync heroku-toolbelt > /dev/null
2013-07-17 13:26:12 +00:00
# node app setup
cd /home/haki && git clone git@bitbucket.org:rulemotion/$REPO.git
cd /home/haki && chown -R haki:haki $REPO
2013-07-17 13:26:12 +00:00
cd /home/haki/$REPO && sudo -u haki npm install
2013-07-17 13:03:05 +00:00
2013-07-17 13:26:12 +00:00
# system service setup
cp /home/haki/$REPO/scripts/haki.service /etc/systemd/system/haki.service
2013-07-17 13:03:05 +00:00
systemctl enable haki
systemctl start haki