Rogue Class Linux Download Login

Artifact Content

Artifact a3f45f00ee8ccfaf880ffe12265235265293d99c:


#!/bin/sh
result=$(mktemp)
trap onexit EXIT

onexit()
{
    rm -f $result
}

main()
{
    dir="$1"
    fname="$2"
    bufname="$3"

    dialog --title "Save file as $bufname" --getsavefilename "$dir" \
        "$fname" 0 0 2>$result
    if [ $? -ne 0 ]
    then
        return
    fi

    fname=$(<$result)
    cat "$bufname" >"$fname"
    rig ~/settings/history.cfg pop $(tty)
    rig ~/settings/history.cfg push $(tty) "ded \"$fname\""
    return
}

main "$1" "$2" "$3"
exit