Skip to content
Snippets Groups Projects
Commit 1fb899c9 authored by Dennis Eisold's avatar Dennis Eisold
Browse files

Update install.sh

parent 60fec84c
No related branches found
No related tags found
No related merge requests found
Pipeline #36 canceled with stages
apt install -y etckeeper git
#!/bin/bash
if (($# == 1))
then
echo "$1"
Token=$1
else
echo 'usage: install.sh YourAccessToken'
exit
fi
Gitlab_Host="https://www.gitrepo.de"
Gitlab_Repo="https://www.gitrepo.de/opensource/etckeeper_install/raw/master"
key_pub=$(<~/.ssh/id_rsa.pub)
hostname=`hostname -f`
curl --data-urlencode "key=$key_pub" --data-urlencode "title=$hostname" $Gitlab_Host/api/v4/user/keys?private_token=$Token
apt install -y etckeeper git wget
ssh-keyscan ssh.gitrepo.de >> ~/.ssh/known_hosts
echo "VCS=\"git\"
AVOID_SPECIAL_FILE_WARNING=1
PUSH_REMOTE=\"origin\"" > /etc/etckeeper/etckeeper.conf
cd /etc
git init
git config --global user.name "roadit_ectkeeper"
git config --global user.email "ectkeeper@roadit.de"
git config --global core.editor "nano"
git config --global push.default simple
git remote add origin git@ssh.gitrepo.de:roadit/etckeeper/`hostname -f`.git
git remote add origin git@ssh.gitrepo.de:roadit/etckeeper/$hostname.git
etckeeper commit "initial commit"
wget https://www.gitrepo.de/opensource/etckeeper_install/raw/master/logout_trap.sh -O /usr/local/share/logout_trap.sh
wget $Gitlab_Repo/logout_trap.sh -O /usr/local/share/logout_trap.sh
chmod +x /usr/local/share/logout_trap.sh
echo "/usr/local/share/logout_trap.sh" >> ~/.profile
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment