summaryrefslogtreecommitdiff
path: root/scripts/fetch-salt-from-emacs.sh
blob: 9e64de866cfb0740edb6f8047287c5aa94a14184 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/bash
if [ "$EUID" -ne 0 ]
  then echo "Please run as root"
  exit
fi
qvm-run emacs-salt 'mv /home/user/Documents/salt-repo/.git /tmp/salt.git'
qvm-run emacs-salt 'cd /home/user/Documents && tar -cf /tmp/salt.tar salt-repo'
qvm-run emacs-salt 'mv /tmp/salt.git /home/user/Documents/salt-repo/.git'
qvm-run --pass-io emacs-salt 'cat /tmp/salt.tar' > /tmp/salt.tar && qvm-run emacs-salt 'rm /tmp/salt.tar'
rm -fr /root/user_salt.bak
mv /srv/user_salt /root/user_salt.bak
cd /tmp && tar -xf /tmp/salt.tar
mv /tmp/salt-repo /srv/user_salt