Article 6HTH8 Problem with script; How to do it

Problem with script; How to do it

by
ninjanoir78
from LinuxQuestions.org on (#6HTH8)
Hi,

I am a newbie and I found that script but I need some helps about it.

the first script, I create a back up and encrypted it;

Code:####savesettings
#!/bin/sh
cd /etc
tar -czv -f /tmp/JIMsettings \
config/network config/https-dns-proxy \
config/wireless config/firewall config/dhcp config/banip config/dropbear sysupgrade.conf \
dropbear/authorized_keys
if [ "$?" -eq 0 ] ; then
ccencrypt -vf /tmp/JIMsettings
if [ "$?" -eq 0 ] ; then
cp -f /tmp/JIMsettings.cpt /etc/JIMsettings.$1.cpt
fi
fithe problem is with the second one, I don't know how to apply it, I got errors.

Code:###applysettings
#!/bin/sh
cp -f $1 /tmp/JIMsettings.cpt
if [ "$?" -eq 0 ] ; then
ccdecrypt -vf /tmp/JIMsettings.cpt
if [ "$?" -eq 0 ] ; then
tar -xzv -f /tmp/JIMsettings -C /etc
chmod 744 /etc/dropbear/authorized_keys
sync
fi
fiI try to run it from /etc

/etc# ./applysettings

I got;

Code:/etc# ./applyHNsettings.sh
BusyBox v1.36.1 (2024-01-09 18:37:19 UTC) multi-call binary.

Usage: cp [-arPLHpfinlsTu] SOURCE DEST
or: cp [-arPLHpfinlsu] SOURCE... { -t DIRECTORY | DIRECTORY }

Copy SOURCEs to DEST

-a Same as -dpR
-R,-r Recurse
-d,-P Preserve symlinks (default if -R)
-L Follow all symlinks
-H Follow symlinks on command line
-p Preserve file attributes if possible
-f Overwrite
-i Prompt before overwrite
-n Don't overwrite
-l,-s Create (sym)links
-T Refuse to copy if DEST is a directory
-t DIR Copy all SOURCEs into DIR
-u Copy only newer filesCould you help me?
thanks
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments