1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 13:18:35 -06:00

Modify destination options

This commit is contained in:
Sayantan Santra 2022-07-30 02:26:09 -05:00
parent 558a8a0765
commit cef8150084

View file

@ -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 <script-location> <destination> (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