[Assorted-commits] SF.net SVN: assorted: [802] configs/trunk/setup-cron.bash
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-05-13 07:44:26
|
Revision: 802 http://assorted.svn.sourceforge.net/assorted/?rev=802&view=rev Author: yangzhang Date: 2008-05-13 00:44:31 -0700 (Tue, 13 May 2008) Log Message: ----------- added informational output to prereq checking; fixed the bashrc checking; added final done output Modified Paths: -------------- configs/trunk/setup-cron.bash Modified: configs/trunk/setup-cron.bash =================================================================== --- configs/trunk/setup-cron.bash 2008-05-13 07:43:35 UTC (rev 801) +++ configs/trunk/setup-cron.bash 2008-05-13 07:44:31 UTC (rev 802) @@ -2,7 +2,7 @@ # Installs cron jobs. -. common.bash +. common.bash || exit 1 shopt -s extglob @@ -13,20 +13,28 @@ install .cron/ cron/!(crontab) -silence type duplicity -silence type gbookmark2delicious.py -[ -f ~/.gbookmark2delicious.auth ] -silence type mlf.py -[ -f ~/.mlf.auth ] -silence type mysqldump -[ -f ~/.y_z.cnf ] +check() { + local arg="$1" + if [[ "${arg:0:1}" == / ]] + then [ -f "$arg" ] || die "could not find file $arg" + else silence type "$arg" || die "could not find proram $arg" + fi +} +check duplicity +check gbookmark2delicious +check ~/.gbookmark2delicious.auth +check mlf.py +check ~/.mlf.auth +check mysqldump +check ~/.y_z.cnf + if ! silence crontab -l then crontab - < crontab else warn "crontab already exists; not overwriting." fi -if fgrep PS1 ~/.bashrc && ! fgrep ~/.bashrc FORCE_BASHRC ~/.bashrc ; then +if silence fgrep PS1 ~/.bashrc && ! silence fgrep FORCE_BASHRC ~/.bashrc ; then # NOTE: do not try to use "$( ... )" here instead of backticks, since that # will break this! warn "` cat << "EOF" @@ -37,3 +45,5 @@ EOF `" fi + +echo done! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |