From d7b339c66b9f60fe947c5e10f89b15cb169a36c3 Mon Sep 17 00:00:00 2001 From: Cyteen May Date: Sat, 13 Apr 2019 15:41:58 +0100 Subject: [PATCH] New scripts push before pull. --- 020_etckeeper.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++++ 020_nanorc.sh | 30 +++++++++++++++++++++ 020_vcsh.sh | 1 + 3 files changed, 100 insertions(+) create mode 100644 020_etckeeper.sh create mode 100644 020_nanorc.sh create mode 100644 020_vcsh.sh diff --git a/020_etckeeper.sh b/020_etckeeper.sh new file mode 100644 index 0000000..9f5510c --- /dev/null +++ b/020_etckeeper.sh @@ -0,0 +1,69 @@ +apt-get install -y etckeeper git openssh-client + +# use the GitLab API to create a project +# https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#create-project + +# POST /projects + +# One of the optional parameters is: + +# visibility_level (optional): +# 0 is Private (Project access must be granted explicitly for each user) +# 10 is Internal (The project can be cloned by any logged in user), +# 20 is Public (The project can be cloned without any authentication) + +cat /dev/zero | ssh-keygen -b 2048 -t rsa -q -N "" + +PROJECT_NAME=$(uname -n)_etc # myproject +GITLAB_SERVER="http://example.com" +PROJECT_URL="${GITLAB_SERVER}/api/v3/projects" +KEYS_URL="${GITLAB_SERVER}/api/v3/user/keys" +PRIVATE_TOKEN=QVy1PB7sTxfy4pqfZM1U +PROJECT_VISIBILITY=0 +PROJECT_DESCRIPTION="Tracking for the /etc/folder on $(uname -n)" +MACHINE_PUBKEY=/root/.ssh/id_rsa.pub + +cat > ~/.ssh/config < ./description-pak << EOF +dot nanorc files that have improved definitions of syntax highlighting for various languages in the nano editor. +EOF + + +checkinstall -y --fstrans \ + --pkgname=nanorc \ + --pkgversion=1.0 \ + --pkgrelease=1 \ + --pkgarch=amd64 \ + --pkggroup=admin \ + --pkglicense=LICENSE \ + --pkgsource=${LATEST_URL} \ + --maintainer=cyteen@ring-zero.co.uk \ + --requires=nano,unzip,wget \ + -D \ + git clone ${LATEST_URL} ${DIR_NAME} + cp ${DIR_NAME}/*.nanorc ${install_path} && \ + echo "include ${install_path}/*.nanorc" >> /etc/nanorc + + diff --git a/020_vcsh.sh b/020_vcsh.sh new file mode 100644 index 0000000..26811b0 --- /dev/null +++ b/020_vcsh.sh @@ -0,0 +1 @@ +apt-get install -y vcsh mr