($host) || usage("Host not specified\n"); ($user) || usage("SFTP Username not specified\n"); ($password) || usage("SFTP password not specified\n"); ($file) || usage("File to upload and download not specified\n"); ($opt_w) || usage("Warning threshold not specified\n"); ($opt_c) || usage("Critical threshold not specified\n");
Compare sorted files FILE1 and FILE2 line by line.
With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files.
# Sanity check if [ $# -ne 4 ]; then echo "Usage: $0 -w WARNING -c CRITICAL" exit fi
while getopts ":w:c:" optname do case "$optname" in "w") WARNING=$OPTARG ;; "c") CRITICAL=$OPTARG ;; "?") echo -e "Unknown option $OPTARG\nUsage: $0 -w WARNING -c CRITICAL" ;; ":") echo "No argument value for option $OPTARG" ;; *) # Should not occur echo "Unknown error while processing options" ;; esac done
#add the user the user ip address with authentication like this
host all all 10.1.19.12/32 md5
3. su - postgres
createuser user1
3. last step is to add the user to the db
alter user user1 with encrypted password 'XXXXXX';
4. grant all on tablex to user1 or run these on the db select 'grant all on '||schemaname||'.'||tablename||' to bar;' from pg_tables where schemaname in ('public') order by schemaname, tablename;