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
|
2013-07-17 13:40:07 +00:00
|
|
|
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
|
2013-07-17 13:40:07 +00:00
|
|
|
cp /home/haki/$REPO/scripts/haki.service /etc/systemd/system/haki.service
|
2013-07-17 13:03:05 +00:00
|
|
|
systemctl enable haki
|
2013-07-17 13:40:07 +00:00
|
|
|
systemctl start haki
|