aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xadd-shell9
1 files changed, 5 insertions, 4 deletions
diff --git a/add-shell b/add-shell
index 099bdaa..e5efbc6 100755
--- a/add-shell
+++ b/add-shell
@@ -26,8 +26,9 @@ if [ ! -f $CFG_FILE ]; then
> $CFG_FILE
fi
-grep -qv "^$shl$" $CFG_FILE && \
- (cat /etc/shells;echo /bin/TSH) | sort | uniq > $CFG_FILE.new
-[[ -f $CFG_FILE.new ]] && mv -f $CFG_FILE.new $CFG_FILE
+if ! grep -q "^$shl$" $CFG_FILE; then
+ (cat $CFG_FILE; echo "$shl") | sort | uniq > $CFG_FILE.new
+ mv -f $CFG_FILE.new $CFG_FILE
+fi
-exit 0 \ No newline at end of file
+exit 0