You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

42 lines
918 B

if [ -z "$_PROFILES_PATH" ]; then
_MAIN_PATHC=/opt/profiles/scripts/
else
_MAIN_PATHC=${_PROFILES_PATH}scripts/
fi
if [ ! -d ~/.ssh ]; then
${_MAIN_PATHC}make_a_key.sh
fi
refresh() {
cmdlist=()
IFSOLD=$IFS
IFS=',';
while read -r label mycommand desc;
do
[[ $label =~ ^#.* ]] && continue
desc=${desc/!GUEST/$GUEST}
desc=${desc/!REMOTE/$REMOTE}
desc=${desc/!LOCAL/$LOCAL}
desc=${desc/!DEST/$DEST}
desc=${desc/!home/$home}
desc=${desc/!target/$target}
cmdlist+=("$label" "$desc" )
done < "${_RUN_CMDS_FILE}"
IFS=$IFSOLD
}
cmd() {
IFSOLD=$IFS
IFS=','
while read -r label user_command desc;
do
[[ $label =~ ^#.* ]] && continue
[[ "$command" == "$label" ]] && break
done < "${_RUN_CMDS_FILE}"
IFS=$IFSOLD
[[ "$command" == "$label" ]] && { $user_command; return; }
}