shell.sh (1148B)
1 #!/bin/bash 2 3 cd $ROOT_DIR 4 DOT_FILES="lastpass weechat ssh Xauthority" 5 for dotfile in $DOT_FILES; do conform_link "$DATA_DIR/$dotfile" ".$dotfile"; done 6 7 # }}} 8 # crontab update from file {{{ 9 # TODO: refactor with suffix variables (or common cron values) 10 11 case "$PLATFORM" in 12 linux) 13 #conform_link "$CONF_DIR/shell/zshenv" ".zshenv" 14 crontab -l > $ROOT_DIR/tmp/crontab-conflict-arch 15 cd $ROOT_DIR/$CONF_DIR/cron 16 if [[ "$(diff ~/tmp/crontab-conflict-arch crontab-current-arch)" == "" 17 ]]; 18 then # no difference with current backup 19 logger "$LOG_PREFIX: crontab live settings match stored "\ 20 "settings; no restore required" 21 rm ~/tmp/crontab-conflict-arch 22 else # current crontab settings in file do not match live settings 23 crontab $ROOT_DIR/$CONF_DIR/cron/crontab-current-arch 24 logger "$LOG_PREFIX: crontab stored settings conflict with "\ 25 "live settings; stored settings restored. "\ 26 "Previous settings recorded in ~/tmp/crontab-conflict-arch." 27 fi 28 ;; 29