#!/bin/ash set -ex #Usage: repos repos() { cat > /etc/apk/repositories < /tmp/new.cron >>EOF EOF else cat > /tmp/new.cron < /etc/motd' crontab_append() { printf "$1\n" | tee -a /tmp/new.cron } #Usage: apply_crontab apply_crontab() { crontab /tmp/new.cron } #Usage: iptables_conf #Variables: iptables_conf() { if [ ! -f /etc/iptables/salt.rules ]; then touch /etc/iptables/salt.rules else rm /etc/iptables/salt.rules fi cat > /etc/iptables/salt.rules < /etc/salt/gpgkeys/genscript < /etc/salt/gpgkeys/salt_pub.gpg gpg --import /etc/salt/gpgkeys/salt_pub.gpg fi if [ ! -d /etc/salt/master.d ]; then mkdir -p /etc/salt/master.d fi for conf in file.conf pillar.conf primary.conf security.conf state.conf reactor.conf; do if [ -f /etc/salt/master.d/$conf ]; then mv /etc/salt/master.d/$conf /etc/salt/master.d/$conf.bak fi done cat > /etc/salt/master.d/file.conf < /etc/salt/master.d/pillar.conf < /etc/salt/master.d/primary.conf < /etc/salt/master.d/security.conf < /etc/salt/master.d/state.conf < /etc/salt/master.d/reactor.conf <