diff --git a/push_script_to.sh b/push_script_to.sh index b47f0e5..e6d344f 100644 --- a/push_script_to.sh +++ b/push_script_to.sh @@ -6,9 +6,11 @@ if [ -z "$1" ]; then echo "Provide a script or pass --help to see syntax" exit + elif [ "$1" == "--help" ];then echo "The syntax is as follows:"$'\n'"push_script_to (additional destinations separated by space)" exit + elif ! [ -f "$1" ]; then echo "The given script doesn't exist" exit @@ -18,7 +20,7 @@ fi for i in "${@:2}" do - if [ "$i" == "local_script_dir" ]; then + if [ "$i" == "personal_script_dir" ]; then cp "$1" "/home/sintan/.local/bin/personal/" chmod +x "/home/sintan/.local/bin/personal/$(basename "$1")" @@ -26,10 +28,14 @@ do sudo cp "$1" "/etc/cron.daily/" sudo chmod +x "/etc/cron.daily/$(basename "$1")" - elif [ "$i" == "cron_weeky" ]; then + elif [ "$i" == "cron_weekly" ]; then sudo cp "$1" "/etc/cron.weekly/" sudo chmod +x "/etc/cron.weekly/$(basename "$1")" + elif [ "$i" == "cron_monthly" ]; then + sudo cp "$1" "/etc/cron.monthly/" + sudo chmod +x "/etc/cron.monthly/$(basename "$1")" + else echo "Unrecognized destination: $i" fi done \ No newline at end of file